RE: FW: XSL processes XML incorrectly when uneven num
Tsk, tsk, tsk. 1) The data document isn't well-formed. <optionList1> <option>1</option> <option>2</option> </List1> Note the opening tag doesn't match the closing tag, therefor this isn't XML. Now, correcting this, I moved on to the XSLT and found that what it's trying to output isn't HTML: <xsl:for-each select="//enquiry-data/free-xml/optionList1/*"> <xsl:value-of select="."/></a><br/> </xsl:for-each> Note the closing </a> doesn't have a matching opener (<a>). Now how about an example output of what you want to get from the transformation, or at least, tell us whether each <optionListx> should produce a row in the output or should it produce a column in which case the <option> elements with matching positions relative to it's siblings make up the successive <td> elements in the output. (This last sentence is why I recommend example output rather than descriptions of the desired output.) And here's another piece of advice. If you have any control over the XML format, immediately kill the idea that each <optionListx> element should have a unique name. If you need to differentiate them, use an attribute. So ... <optionList1> becomes <optionList id="1"> <optionList2> becomes <optionList id="2"> <optionList3> becomes <optionList id="3"> This will make writing and maintaining a stylesheet much easier. -- Charles Knell cknell@xxxxxxxxxx - email
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format