ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: [Xerces-J] DOM and Schema information


dom setfeature
DOM3 (in JAXP 1.3 and/or JDK 1.5) supports the methods
Element.getSchemaTypeInfo() and Attr.getSchemaTypeInfo(). These give you
some basic information about the type. In the Saxon implementation you can
get more detailed information by casting the resulting TypeInfo object to a
Saxon-specific class; I imagine the same is true in the Xerces
implementation.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Charles Francoise [mailto:loderunnr@g...] 
> Sent: 27 June 2005 17:41
> To: xml-dev@l...
> Subject:  [Xerces-J] DOM and Schema information
> 
> 
> I'm parsing an XML file with Xerces and DOM. I validate my 
> XML Instance 
> against a schema without problems.
> I'd like to obtain some schema information on the nodes though, in 
> particular, I'd like to know what type they are declared to be in the 
> schema.
> I understand that this information can be found through the 
> PSVI, but I 
> can't seem to access it. When I try to obtain my schema 
> information by 
> using:
> rootPSVI.getSchemaInformation()
> I get null.
> Using a debugger, I can also see that all the information concerning 
> validation and PSVI is not affected. Validation is performed 
> though, I 
> can see the errors in case of an invalid XML instance.
> 
> Is there something I forgot to do ? Is there another way to 
> access this ?
> Thank you for your help.
> 
> Charles
> 
> 
> 
> Here is the code I use:
> DOMParser parser = new DOMParser();
> parser.setProperty("http://apache.org/xml/properties/dom/docum
> ent-class-name","org.apache.xerces.dom.PSVIDocumentImpl");
> parser.setFeature("http://xml.org/sax/features/validation", true);
> parser.setFeature("http://apache.org/xml/features/validation/s
> chema", true);
> parser.setFeature("http://apache.org/xml/features/validation/s
> chema-full-checking",true);
> parser.setFeature("http://xml.org/sax/features/namespaces",true);
> parser.parse(file.toURI().toString());
> Document doc = parser.getDocument();
> ElementPSVI rootPSVI = (ElementPSVI) doc.getDocumentElement();
> XSModel schema = rootPSVI.getSchemaInformation();
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
> 



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.