Jump to content

can we trap the result if xsl:value-of select="/xpath" dosent match node


Guest santhoshbkartha

Recommended Posts

Guest santhoshbkartha
:) I use xslt to get a csv format output from an xml document.Three scenarios which i need to handle:1. The node which i refer to in the value-of select statement is present ie xml has tag and value.<messageIdentifier>324057jhfjd</messageIdentifier>2. The node which i refer to in the value-of select statement is not present ie xml dosent have the tag or value.<!--<messageIdentifier>324057jhfjd</messageIdentifier> --> ie no messgeIdentifier tag3. The node which i refer to in the value-of select statement is present but with null value ie xml has tag value pairs.<messageIdentifier></messageIdentifier>First scenario is handled with this statement:messageIdentifier,<xsl:value-of select="/SyncData/Header/messageIdentifier/text()"/>For the second and third scenario i need to get an output like:messageIdentifier,nullCan you please help?Kartha
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...