I am using an XML input file to capture the data. I have created an XML Map file by using SAS XML Mapper and this map file is refered by SAS XML Engine to fetch the data from input XML file with the proper hierarchy.
The real issue is, if the input XML file is not syntactically correct, the XML Engine throws exception. Just wanted to know if there is any way that SAS will first validate the structure of XML file (may be something like XML Schema validation) and if its a valid structure then only SAS will read the file else it will give a message (or return code) saying invalid XML input file.
Any help regarding this issue will be highly appreciated.
where it says on this topic:
"Does the XML Engine Validate an XML Document?
The XML engine does not validate an input XML document. The engine assumes that the data passed to it is in valid, well-formed XML markup. Because the engine does not use a DTD (Document Type Definition) or SCHEMA, there is nothing to validate against."
Look on page 12 of the paper. The author says he is willing to share the Data step code. Since his method essentially bypasses both XMLMapper and PROC TEMPLATE, you would either need to write your own DATA step code or get the code from this paper author.
Also, note that on page 11 of his paper, he says that:
"An alternative to the LIBNAME XML engine for XML import and PROC TEMPLATE for export is to flatten the hierarchical XML into a numerically indexed representation that presents nothing new to the SAS programmer, unlike native XML. This method is the basis for the import and export of XML that takes place 100% in the familiar DATA step."
This flattening of the hierarchy would -still- mean that SAS is NOT checking the XML file for whether it is valid, well-formed or conforming to the schema or DTD. So it would be possible in this method for you to work with a badly formed, and/or invalid XML file.