Package org.enhydra.apache.xerces.validators.schema

Class Summary
GeneralAttrCheck Title: Description: Copyright: Copyright (c) 2001
OneAttr  
OneElement  
SchemaGrammar  
SchemaMessageProvider SchemaMessageProvider implements an XMLMessageProvider that provides localizable error messages for the W3C XML Schema Language
SchemaSymbols Collection of symbols used to parse a Schema Grammar We have temporary references to this class from SchemaImporter but we will be moving all the SchemaImporter functionality to the Grammar classes
SubstitutionGroupComparator  
TraverseSchema Instances of this class get delegated to Traverse the Schema and to populate the Grammar internal representation by instances of Grammar objects.
TraverseSchema.ErrorHandler  
TraverseSchema.IgnoreWhitespaceParser  
TraverseSchema.Resolver Don't check the following code in because it creates a dependency on the serializer, preventing to package the parser without the serializer //Unit Test here public static void main(String args[] ) { if( args.length != 1 ) { System.out.println( "Error: Usage java TraverseSchema yourFile.xsd" ); System.exit(0); } DOMParser parser = new IgnoreWhitespaceParser(); parser.setEntityResolver( (fEntityResolver != null)? (fEntityResolver):(new Resolver()) ); parser.setErrorHandler( new ErrorHandler() ); try { parser.setFeature("http://xml.org/sax/features/validation", false); parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false); }catch( org.xml.sax.SAXNotRecognizedException e ) { e.printStackTrace(); }catch( org.xml.sax.SAXNotSupportedException e ) { e.printStackTrace(); } try { parser.parse( args[0]); }catch( IOException e ) { e.printStackTrace(); }catch( SAXException e ) { e.printStackTrace(); } Document document = parser.getDocument(); //Our Grammar OutputFormat format = new OutputFormat( document ); java.io.StringWriter outWriter = new java.io.StringWriter(); XMLSerializer serial = new XMLSerializer( outWriter,format); TraverseSchema tst = null; try { Element root = document.getDocumentElement();// This is what we pass to TraverserSchema //serial.serialize( root ); //System.out.println(outWriter.toString()); tst = new TraverseSchema( root, new StringPool(), new SchemaGrammar(), (GrammarResolver) new GrammarResolverImpl() ); } catch (Exception e) { e.printStackTrace(System.err); } parser.getDocument(); }
XUtil Some useful utility methods.
 



Copyright © 1999 The Apache Software Foundation. All Rights reserved.