Pinned topic Can Cast Iron validate an xml file against an xsd file?
Sathya400 2700057BXV13 Posts
SwethaRai 270005X65V47 PostsACCEPTED ANSWER
Re: Can Cast Iron validate an xml file against an xsd file?2013-11-25T11:51:12Z in response to Sathya400
To validate a XML from a source application for the NULL/Blank values, do we have built -in function or a custom function should be coded?
Please help with the logic for checking NULL values in an incoming source xml (for mandatory field check)
michaelkdown 2700050J9T36 PostsACCEPTED ANSWER
Re: Can Cast Iron validate an xml file against an xsd file?2013-12-03T17:07:15Z in response to PingLu
An Validate XML activity can not be used to check if there is content INSIDE of an element it can only check if that element is present. So if for example you have a field called "telephone_number" and your schema definition is set to minOccurs="1" then the following scenarios will pass/fail
Element not present ---- FAIL ----
Element looks like this - <telephone_number/> --- PASS ---- As node is present but it doesnt care about content
Element looks like this - <telephone_number>0123456798</telephone_number> --- PASS ---- Node is present so passes and happens to have content.
If you want to check if a node has content you have to create a customer XSLT that looks inside the nodes you will need to use logic that looks like this:<xsl:if test="telephone_number != '' or telephone_number">[ADD SOME LOGIC IN HERE]</xsl:if>
This simple if statement looks for both the node has data != '' part and that the node is there.