yeah I was headed to w3schools :) Thanks. I'll take a look at this. If I can get the data into a decent format I may be able to get it loaded my end. Which would be wonderful. Think of all the hours freed up to cause havoc on cf-community ;)
>> -----Original Message----- > >Then it's a balancing act: is it easier to make it well formed or to parse >it out as it is? > >Often the core data will be well formed - so just snipping off the "ends" of >the document will sometimes fix things. > >XSLT is a tool for transforming XML into - it's pretty cumbersome and a >little tedious, but not difficult (definitely easier than learning/doing >manual parsing). The w3cschools site has a brief, but useful overview of >the process here: > >http://www.w3schools.com/xsl/xsl_transformation.asp > >That demo shows the results in a browser, but in your case you'd probably >apply the XSL file separately in a script - but the results would be the >same. That also shows converting an XML doc to HTML, but I hope you get the >idea - the XSLT works a lot like CF: it "lives" within the presentation >format and describes how data should be inserted. > >I've done this with pre-defined XSL files to good effect but I'm not sure I >could write one up myself without some study first. > >The tricky bit for you may be dealing with multiple TD's but XSL deals with >that with positional requestors. XPATH is the "language" used in XSL for >selecting specific nodes. Again, it's tedious but straightforward (if you >have a decent reference on hand). For example to select the first TD under >a TR you might use this expression: "/tr/td[0]". > >Taking a snippet from your sample: > ><TR> ><TH CLASS="ddlabel" scope="row" >Cross List: </TH> <TD >CLASS="dddefault">0</TD> <TD CLASS="dddefault">0</TD> <TD >CLASS="dddefault">0</TD> </TR> > >To get the data from that and convert it to a comma-seperated list you might >do something like this: > ><xsl:for-each select="tr"> > <xsl:value-of select="td[0]"/>,<xsl:value-of select=" >td[1]"/>,<xsl:value-of select=" td[2]"/> ></xsl:for-each> > >Of course you need to test all of this (I think the above might actually >result in empty rows, you might have to comment or collapse some of the line >breaks). > >It's confusing at first, but really pretty powerful. > >Jim Davis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Community/message.cfm/messageid:233520 Subscription: http://www.houseoffusion.com/groups/CF-Community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
