In xerces-java, it is as simple as:
 
----------------------------------------------------------------------
 
dbf.setNamespaceAware(true);
dbf.setValidating(true);
dbf.setAttribute("http://apache.org/xml/features/validation/schema",
    Boolean.TRUE);
dbf.setAttribute("http://apache.org/xml/properties/dom/document-class-name",
   "org.apache.xerces.dom.PSVIDocumentImpl");
         
Document doc = db.parse("person.xml");
Element documentElement = doc.getDocumentElement() ;
if (documentElement.isSupported("psvi", "1.0")){
    ElementPSVI psviElem = (ElementPSVI)doc.getDocumentElement();
    XSModel model = psviElement.getSchemaInformation();
    XSElementDeclaration decl = psviElem.getElementDeclaration();
----------------------------------------------------------------------------------------
 
And in xerces-c, how can I do this to get an XSModel object(ptr)?
 
Thanks,
Lin

Reply via email to