Page 1 of 1

XSL choose several

Posted: Mon Mar 25, 2019 5:59 pm
by tAnd
I am currently stuck at a problem with xsl.
Example:
XML:

<Idoc>
- <invoice01>
- <asd>000010</asd>
- <jkl>12</jkl>
- </invoice01>
<Idoc>

The problem is that i have around 100 files with different information in <asd> and i want to differentiate by that value.

xsl:
<xsl:stylesheet>
<Order>
<xsl:for-each select="/Idoc/invoice01">
<xsl:if test="ASD=000010">
<cbc:Quantity><xsl:value-of select="/Idoc/invoice01[asd='000010']/jkl"/></cbc:Quantity>

A different xml file could be:

<Idoc>
- <invoice01>
- <asd>000090</asd>
- <jkl>12</jkl>
- </invoice01>
- <invoice02>
- <asd>000080</asd>
- <jkl>20</jkl>
- </invoice02>
<Idoc>

I am therefor looking for a way to separate the information, but also be able to apply several quantities if needed.

Re: XSL choose several

Posted: Tue Mar 26, 2019 1:27 pm
by tAnd
it should be said i am working in xsl:stylesheet version 1.0 encoding utf-8