How exit from xsl:for-each

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<pre>Want to parse below Request xml to Response xml using one stylesheet (xsl file). If both ImageCount and FPrintCount nodes have empty value, ignore it. I plan to use for-each loop to find ImageCount or FPrintCount. If any one has value, I will add one Field node with one attribute called Name and then exit. Then use for-each loop again to add value for this node. I donnot know how to exit for-each loop. Any idea how to use stylesheet to convert Request xml to Respose xml. thanks Gary [/code]
<pre><Request>



<EyeColor>Brown</EyeColor>



<ImageCount>1</ImageCount>



<FPrintCount>2</FPrintCount>



<Description>test</Description>



</Request>







<Response> <Object>



<Field Name="EyeColor Brown</Field>



<Field Name="Description test</Field>



<Field Name="Binary ImageCount;FPrintCount</Field>



</Object></Response>[/code]

View the full article
 
Back
Top