While parsing the XML message using XML input stage, for some of the Xpaths (mentioned in Output tab) we don't have values in the source XML file. But for this the values needs to populate as Null.
I have tried with options available in XMl stage, but no luck.
Also i am getting the below mentioned warning and the records are dropping.
XML_Input_3,0: Warning: Jb_XML_InputStage_New.XML_Input_3: XML input document parsing failed. Reason: Xalan fatal error (publicId: , systemId: , line: 166, column: 6): Expected end of tag 'ns1:tradingTimestamps'
Can anyone let me know how to resolve this issue.
This topic has been locked.
1 reply Latest Post - 2011-11-11T07:08:30Z by mukulg
Pinned topic How to pass the missing value for XPath from Xml Input Stage
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-11-11T07:08:30Z at 2011-11-11T07:08:30Z by mukulg
mukulg 060001WFFW28 PostsACCEPTED ANSWER
Re: How to pass the missing value for XPath from Xml Input Stage2011-11-11T07:08:30Z in response to Venki52The error trace you've posted seems to tell, that Xalan is present in your technical environment. So possibly, an XSLT 1.0 fragment like below may be feasible to handle this situation (assuming you want to test the existence or the value of element "a"),
<xsl:variable name= "effectiveVal"> <xsl:choose> <xsl:when test= "not(a = '')"> <!-- OR possibly, not(a) --> <xsl:value-of select= "a"/> </xsl:when> <xsl:otherwise> <xsl:text>Null</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable>
If you can use XPath 2.0, this might be accomplished with following expressions,
if (not(a = '')) then a else 'Null'
if (not(a)) then a else 'Null'