/** * @param fallbackParser * This parser will be used when DOMForestParser needs to parse * documents that are not in the forest. */ DOMForestParser( DOMForest forest, XMLParser fallbackParser ) { this.forest = forest; this.scanner = new DOMForestScanner(forest); this.fallbackParser = fallbackParser; }
/** * Generates the whole set of SAX events from the given Document * in the DOMForest. */ public void scan( Document d, ContentHandler contentHandler ) throws SAXException { scan( d.getDocumentElement(), contentHandler ); }
/** * Parses a set of schemas inside a WSDL file. * * A WSDL file may contain multiple <xsd:schema> elements. */ private XSSchemaSet loadWSDL() throws SAXException { // build DOMForest just like we handle XML Schema DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() ); DOMForestScanner scanner = new DOMForestScanner(forest); XSOMParser xsomParser = createXSOMParser( forest ); // find <xsd:schema>s and parse them individually for( InputSource grammar : opt.getGrammars() ) { Document wsdlDom = forest.get( grammar.getSystemId() ); NodeList schemas = wsdlDom.getElementsByTagNameNS(WellKnownNamespace.XML_SCHEMA,"schema"); for( int i=0; i<schemas.getLength(); i++ ) scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() ); } return xsomParser.getResult(); }
/** * Parses a set of schemas inside a WSDL file. * * A WSDL file may contain multiple <xsd:schema> elements. */ private XSSchemaSet loadWSDL() throws SAXException { // build DOMForest just like we handle XML Schema DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() ); DOMForestScanner scanner = new DOMForestScanner(forest); XSOMParser xsomParser = createXSOMParser( forest ); // find <xsd:schema>s and parse them individually for( InputSource grammar : opt.getGrammars() ) { Document wsdlDom = forest.get( grammar.getSystemId() ); NodeList schemas = wsdlDom.getElementsByTagNameNS(WellKnownNamespace.XML_SCHEMA,"schema"); for( int i=0; i<schemas.getLength(); i++ ) scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() ); } return xsomParser.getResult(); }
/** * Parses a set of schemas inside a WSDL file. * * A WSDL file may contain multiple {@code <xsd:schema>} elements. */ private XSSchemaSet loadWSDL() throws SAXException { // build DOMForest just like we handle XML Schema DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() ); DOMForestScanner scanner = new DOMForestScanner(forest); XSOMParser xsomParser = createXSOMParser( forest ); // find <xsd:schema>s and parse them individually for( InputSource grammar : opt.getGrammars() ) { Document wsdlDom = forest.get( grammar.getSystemId() ); if (wsdlDom == null) { String systemId = Options.normalizeSystemId(grammar.getSystemId()); if (forest.get(systemId) != null) { grammar.setSystemId(systemId); wsdlDom = forest.get( grammar.getSystemId() ); } } NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema"); for( int i=0; i<schemas.getLength(); i++ ) scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() ); } return xsomParser.getResult(); }
/** * Generates the whole set of SAX events from the given Document * in the DOMForest. */ public void scan( Document d, ContentHandler contentHandler ) throws SAXException { scan( d.getDocumentElement(), contentHandler ); }
/** * @param fallbackParser * This parser will be used when DOMForestParser needs to parse * documents that are not in the forest. */ DOMForestParser( DOMForest forest, XMLParser fallbackParser ) { this.forest = forest; this.scanner = new DOMForestScanner(forest); this.fallbackParser = fallbackParser; }
/** * Parses a set of schemas inside a WSDL file. * * A WSDL file may contain multiple {@code <xsd:schema>} elements. */ private XSSchemaSet loadWSDL() throws SAXException { // build DOMForest just like we handle XML Schema DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() ); DOMForestScanner scanner = new DOMForestScanner(forest); XSOMParser xsomParser = createXSOMParser( forest ); // find <xsd:schema>s and parse them individually for( InputSource grammar : opt.getGrammars() ) { Document wsdlDom = forest.get( grammar.getSystemId() ); if (wsdlDom == null) { String systemId = Options.normalizeSystemId(grammar.getSystemId()); if (forest.get(systemId) != null) { grammar.setSystemId(systemId); wsdlDom = forest.get( grammar.getSystemId() ); } } NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema"); for( int i=0; i<schemas.getLength(); i++ ) scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() ); } return xsomParser.getResult(); }
/** * Generates the whole set of SAX events from the given Document * in the DOMForest. */ public void scan( Document d, ContentHandler contentHandler ) throws SAXException { scan( d.getDocumentElement(), contentHandler ); }
/** * @param fallbackParser * This parser will be used when DOMForestParser needs to parse * documents that are not in the forest. */ DOMForestParser( DOMForest forest, XMLParser fallbackParser ) { this.forest = forest; this.scanner = new DOMForestScanner(forest); this.fallbackParser = fallbackParser; }
/** * Parses a set of schemas inside a WSDL file. * * A WSDL file may contain multiple {@code <xsd:schema>} elements. */ private XSSchemaSet loadWSDL() throws SAXException { // build DOMForest just like we handle XML Schema DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() ); DOMForestScanner scanner = new DOMForestScanner(forest); XSOMParser xsomParser = createXSOMParser( forest ); // find <xsd:schema>s and parse them individually for( InputSource grammar : opt.getGrammars() ) { Document wsdlDom = forest.get( grammar.getSystemId() ); if (wsdlDom == null) { String systemId = Options.normalizeSystemId(grammar.getSystemId()); if (forest.get(systemId) != null) { grammar.setSystemId(systemId); wsdlDom = forest.get( grammar.getSystemId() ); } } NodeList schemas = wsdlDom.getElementsByTagNameNS(XMLConstants.W3C_XML_SCHEMA_NS_URI,"schema"); for( int i=0; i<schemas.getLength(); i++ ) scanner.scan( (Element)schemas.item(i), xsomParser.getParserHandler() ); } return xsomParser.getResult(); }
/** * Generates the whole set of SAX events from the given Document * in the DOMForest. */ public void scan( Document d, ContentHandler contentHandler ) throws SAXException { scan( d.getDocumentElement(), contentHandler ); }
/** * @param fallbackParser * This parser will be used when DOMForestParser needs to parse * documents that are not in the forest. */ DOMForestParser( DOMForest forest, XMLParser fallbackParser ) { this.forest = forest; this.scanner = new DOMForestScanner(forest); this.fallbackParser = fallbackParser; }
new DOMForestScanner(forest).scan(item,loader); BIDeclaration decl = (BIDeclaration)unmarshaller.getResult();
/** * Generates the whole set of SAX events from the given Document * in the DOMForest. */ public void scan( Document d, ContentHandler contentHandler ) throws SAXException { scan( d.getDocumentElement(), contentHandler ); }
/** * @param fallbackParser * This parser will be used when DOMForestParser needs to parse * documents that are not in the forest. */ DOMForestParser( DOMForest forest, XMLParser fallbackParser ) { this.forest = forest; this.scanner = new DOMForestScanner(forest); this.fallbackParser = fallbackParser; }
new DOMForestScanner(forest).scan(item,loader); BIDeclaration decl = (BIDeclaration)unmarshaller.getResult();
public void parse( InputSource source, ContentHandler contentHandler, ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException { String systemId = source.getSystemId(); Document dom = forest.get(systemId); if(dom==null) { // if no DOM tree is built for it, // let the fall back parser parse the original document. // // for example, XSOM parses datatypes.xsd (XML Schema part 2) // but this will never be built into the forest. fallbackParser.parse( source, contentHandler, errorHandler, entityResolver ); return; } scanner.scan( dom, contentHandler ); } }
new DOMForestScanner(forest).scan(item,loader); BIDeclaration decl = (BIDeclaration)unmarshaller.getResult();
public void parse( InputSource source, ContentHandler contentHandler, ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException { String systemId = source.getSystemId(); Document dom = forest.get(systemId); if(dom==null) { // if no DOM tree is built for it, // let the fall back parser parse the original document. // // for example, XSOM parses datatypes.xsd (XML Schema part 2) // but this will never be built into the forest. fallbackParser.parse( source, contentHandler, errorHandler, entityResolver ); return; } scanner.scan( dom, contentHandler ); } }