One way is to check for the "xsi:schemaLocation" or
"xsi:noNamespaceSchemaLocation" attribute in the Attributes object of the
startElement() callback, usually, but not necessarily, on the root element.

Don't know if this is the simplest or most elegant, though.



                                                                                
                                                   
                      "Michael Ryan                                             
                                                   
                      Bannon"                  To:       <[EMAIL PROTECTED]>    
                                        
                      <[EMAIL PROTECTED]        cc:                             
                                                    
                      oo.ca>                   Subject:  how to double-check 
XML schema used                                       
                                                                                
                                                   
                      09/12/2002 02:13                                          
                                                   
                      PM                                                        
                                                   
                      Please respond to                                         
                                                   
                      xerces-j-user                                             
                                                   
                                                                                
                                                   
                                                                                
                                                   




Hi,

I'm using SAX to validate an XML file against a schema.  I'm using the
following code:

   XMLReader parser = XMLReaderFactory.createXMLReader(parserClass);
   parser.setFeature("http://xml.org/sax/features/validation";, true);
   parser.setFeature("http://apache.org/xml/features/validation/schema";,
true);
   parser.setFeature("
http://apache.org/xml/features/validation/schema-full-checking";, true);
   parser.parse("file:///" + interactionSpaceLink);

Once validated, how do I discover what XML Schema was used?  What is the
simplest, most elegant way to do this?  I'm trying to learn about PSVI, but
some of the examples uses out of date.  Any help is greatly appreciated.

Thanks,

Ryan





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to