[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

FW: XSL processes XML incorrectly when uneven number

Subject: FW: XSL processes XML incorrectly when uneven number of values returned in array elements
From: "Cave, Neil" <Neil.Cave@xxxxxxxxxxxxxx>
Date: Thu, 9 Mar 2006 13:34:44 +0100
frirst name last company
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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.