[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] FW: XSL processes XML incorrectly when uneven number
Hello XSL ninjas I have been struggling with some XSL processing that reads an XML document with an inconsistent number of array (list)values that need to be processed into a table. I have an stylesheet that processes an XML document that looks something like this... <enquiry-data> <free-xml> <optionList1> <option>1</option> <option>2</option> </List1> <optionList2> <option>d</option> <option>e</option> <option>f</option> </optionList2> <optionList3> <option>X</option> </optionList3> </free-xml> </enquiry-data> The XSL processing into an HTML table looks like this... <td> <xsl:for-each select="//enquiry-data/free-xml/optionList1/*"> <xsl:value-of select="."/></a><br/> </xsl:for-each> </td> <td> <xsl:for-each select="//enquiry-data/free-xml/optionList2/*"> <xsl:value-of select="."/></a><br/> </xsl:for-each> </td> <td> <xsl:for-each select="//enquiry-data/free-xml/optionList3/*"> <xsl:value-of select="."/></a><br/> </xsl:for-each> </td> The problem is that because the XML returns a different amount of array values (i.e 2 values in optionList1, 3 in 2 and 1 in 3) The XSL displays the resulkts incorrectly. What I means is that if the for:each statement for optionList1 displays the value for 1 from optionList1/option[0] in row 2 or 3 instead of displaying it in the frirst row. How do I ensure that the XSL will display each occurence on the correct table row? I am new to the list and did not want to attach the actual XML and XSL Regards Neil
|
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
|