Xml file structure:
<InvoiceAddress>
<Name>Salauddin Fashion House</Name>
<PostalCode>1219</PostalCode>
<City>Dhaka</City>
<CountryCode>BD</CountryCode>
</InvoiceAddress>
XML file Transformation code:
" if invoice tag not available
<tt:cond s-check="not-initial(ref('INVOICEADD'))">
" if name tag not available.
<tt:cond s-check="not-initial(ref('INVOICEADD.NAME'))">
<Name tt:value-ref="INVOICEADD.NAME"/>
</tt:cond>
" if name tag available.
<tt:cond s-check="initial(ref('INVOICEADD.NAME'))">
<Name tt:value-ref="INVOICEADD.NAME"/>
</tt:cond>
<tt:cond s-check="not-initial(ref('INVOICEADD.POSTALCODE'))">
<PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
</tt:cond>
<tt:cond s-check="initial(ref('INVOICEADD.POSTALCODE'))">
<PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
</tt:cond>
<tt:cond s-check="not-initial(ref('INVOICEADD.CITY'))">
<City tt:value-ref="INVOICEADD.CITY"/>
</tt:cond>
<tt:cond s-check="initial(ref('INVOICEADD.CITY'))">
<City tt:value-ref="INVOICEADD.CITY"/>
</tt:cond>
<tt:cond s-check="not-initial(ref('INVOICEADD.COUNTRYCODE'))">
<CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
</tt:cond>
<tt:cond s-check="initial(ref('INVOICEADD.COUNTRYCODE'))">
<CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
</tt:cond>
</tt:cond>
" if invoice tag available
<tt:cond s-check="initial(ref('INVOICEADD'))">
<InvoiceAddress>
<tt:cond s-check="not-initial(ref('INVOICEADD.NAME'))">
<Name tt:value-ref="INVOICEADD.NAME"/>
</tt:cond>
<tt:cond s-check="initial(ref('INVOICEADD.NAME'))">
<Name tt:value-ref="INVOICEADD.NAME"/>
</tt:cond>
<tt:cond s-check="not-initial(ref('INVOICEADD.POSTALCODE'))">
<PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
</tt:cond>
<tt:cond s-check="initial(ref('INVOICEADD.POSTALCODE'))">
<PostalCode tt:value-ref="INVOICEADD.POSTALCODE"/>
</tt:cond>
<tt:cond s-check="not-initial(ref('INVOICEADD.CITY'))">
<City tt:value-ref="INVOICEADD.CITY"/>
</tt:cond>
<tt:cond s-check="initial(ref('INVOICEADD.CITY'))">
<City tt:value-ref="INVOICEADD.CITY"/>
</tt:cond>
<tt:cond s-check="not-initial(ref('INVOICEADD.COUNTRYCODE'))">
<CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
</tt:cond>
<tt:cond s-check="initial(ref('INVOICEADD.COUNTRYCODE'))">
<CountryCode tt:value-ref="INVOICEADD.COUNTRYCODE"/>
</tt:cond>
</InvoiceAddress>
</tt:cond>