For example we have an xml document as follow.
<root>
<invoiceNumber></invoiceNumber>
</root>
Following is the code snippet to achieve the required output.
<testelemnet>
{
if (data($getTaxData/invoiceNumber) = '')
then attribute documentNumber {"SALES"}
else
attribute documentNumber {data($getTaxData/invoiceNumber)}
}
</testelemnet>
Output is as follow.
<testelement documentNumber ="SALES"/>
Note : If there is an attribute documentNumber within <testelemnet> an error will be raised due to the duplication of the attribute names.
No comments:
Post a Comment