Jump to content

XSLT, recursive If test ...


Recommended Posts




I would like to ask you if there is a way to automate the "if test" statement below for the entire XML source or a portion of it, avoiding check any single element:



XML source:



<ID><xsl:value-of select="NS:PartyIDs/NS:ID"/></ID>
<xsl:if test="NS:PartyIDs/NS:DUNSID !=''"><DUNSID><xsl:value-of select="NS:PartyIDs/NS:DUNSID"/></DUNSID></xsl:if>



XML output:




Taking off "if test", the output became <DUNSID/> which will cause "DUNSID=Null" and reset that value in the final application.

On the other hand as you can see the source is equal to the destination so I could prepare an XML source as much as close to the destination format ... but it will be strictly dependent.



Many Thanks.



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...