xsi:nil="true" in XSLT Map breaks "choose"-"when" loops - annoying
Hello,
Handling "nil" element in choose loops breaks my XSLT tranformation.
As soon as the element is set to nil, either the "otherwise" branch is executed (wrongly) or the XSLT processing stops.
I test with "count" for the existence of the element. Depending on if it is nil,
other elements have to be processed in sub-loops.
I have an XSLT Mapping in JDeveloper.
It processes a SOAP request in the form:
....
<result>
<customerNew>CUSTOMER_NEW_NAME</customerNew>
<customerCurrent>CUSTOMER_NAME</customerCurrent>
</result>
....
which can also be:
....
<result>
<customerNew xsi:nil="true">
</customerNew>
<customerCurrent>CUSTOMER_NAME</customerCurrent>
</result>
....
To check for Nil I use:
<xsl:when test='not(boolean(count(/ns0:changeCustomer/result/customerNew))) and contains(/ns0:changeCustomer/result/customer,"USER_NAME_SOME_BODY")'>
(the xslt maps between two xsd files and we have quite strict schema definitions)
As soon as I use the test statement in a loop, it breaks, even if I test for "true" and do not simply check for count<1 etc.
How can I work with the <customerCurrent> Element, even if the previous element is nilled?
I talked to several experienced developers and nobody could help. They can do checks in plain xsl with xalan, but not in JDeveloper.
This took me five days already...who can advice?
Your help is appreciated very much.