in the above code when the tags <ReferenceTypeCoded> and <RefNum> are empty i get <ListOfReferenceCoded\> in the final output, i tried to get rid of this by adding the if statement before the start of the <ListOfReferenceCoded> tag to ensure that this empty tag does not come in the final output, but instead the tag gets removed for both cases (when there is content and also when there is no content).Any help regarding this is greatly appreciated.
Subject:Parent tags Author:Minollo I. Date:03 Mar 2009 04:24 PM
Consider that if you test something like if(/a/b != null), "null" is an XPath expression computed in the current context item, not "null" the way you would think about it in Java terms; typically you would say if (/a/b) then...
Anyway, have you tried adding an if condition like:
if($Contact /*:AcknowledgePurchaseOrder/*:DataArea/*:PurchaseOrder/*:PurchaseOrderHeader/*:SupplierParty/*:Contact) then ... else ()
If that doesn't help, we would need to take a look at the whole XQuery and a sample XML input.
I assume the above mentioned solution would check if the tag exists in the incoming xml
"Consider that if you test something like if(/a/b != null), "null" is an XPath expression computed in the current context item, not "null" the way you would think about it in Java terms; typically you would say if (/a/b) then... "
but in this case the tags do exist however they are empty, is there a way where i could use the if condition and not show empty tags on the outgoing doc??.I would be grateful if you could point me in the right direction.
Subject:Parent tags Author:Minollo I. Date:05 Mar 2009 11:54 AM
>...
>but in this case the tags do exist however they are empty, is there a
>way where i could use the if condition and not show empty tags on the
>outgoing doc??.I would be grateful if you could point me in the right
>direction.