I am migrating C/C++ code from MSXML to Xerces. Our XML files and our XSD
schema files have version attributes e.g.
XML file starts:
<?xml version="1.0" encoding="UTF-8"?>
<filters version="5".....
and XSD file contains:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><xs:schema
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="5" >
With MSXML, after loading the schema, you can use the following to get the
schema version from the attribute (i.e. "1"):
BSTR bst_schema_version;
ISchema *pischema;
....
pischema->get_version(&bst_schema_version);
We then check that the schema version is gtreater than or equal to the XML file
version - schemas are kept backwards compatible.
How do I do this in Xerces?
I believe I can cache the schema via:
Grammar* grammar = parser->loadGrammar(strXSDFileName.c_str(),
Grammar::SchemaGrammarType, true);
but how to get the value of an attribute on the "xs:schema" statement?
Thanks
David
_________________________________________________________________
Win New York holidays with Kellogg’s & Live Search
http://clk.atdmt.com/UKM/go/111354033/direct/01/