Jump to content
Sign in to follow this  

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.



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...