Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

xsi:nil="true" in XSLT Map breaks "choose"-"when" loops - annoying

user570144Aug 3 2007 — edited Aug 4 2007
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2007
Added on Aug 3 2007
1 comment
1,084 views