Xerces-J XML Schema validation problem
I'm trying to validate an xml file against a schema that references W3C reserved attributes, like xml:base or xml:lang. I'm using the DOMParser.parse () method to parse the file. The problem is that Xerces seems to be unaware of these reserved attributes and tries to resolve the references to them, and so I get the following error message : [ERROR]: src-resolve: Cannot resolve the name 'xml:base' to a(n) 'attribute declaration' component. line: 74, col: 36 Despite this error, calling the DOMParser.getDocument() method after the parse returns a Document object. This is confusing. If there were errors in the parse then why should this method return anything else than null? Even when the xml file contains elements that aren't declared in the schema, Xerces doesn't report them and the DOMParser.getDocument() still returns a Document object, as if everything was OK. Apparently Xerces stops validating the document after encountering the initial xml:base error. The schema I'm using is the IMS Content Packaging Specification schema which can be found at http://www.imsglobal.org/content/packaging/cpv1p1p3/XMLschemas/imscp_v1p1.xsd The xml:base reference in the schema is : <xsd:attributeGroup name = "attr.base"> <xsd:attribute ref = "xml:base"/> </xsd:attributeGroup> at line 73. I would really appreciate some help. P.S. I'm using Xerces 2.6.0
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format