Package com.sun.org.apache.xerces.internal.xni.grammars

Examples of com.sun.org.apache.xerces.internal.xni.grammars.XSGrammar


    }

    private void doSchemaValidation(InputSource wsdlsource, byte[] bytes, Document doc,
                                    StackTraceErrorHandler handler) throws IOException, SAXException {
        if (isSchemaDocument(doc)) {
            XSGrammar xsGrammer = (XSGrammar)preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,
                                                                       copyInputSourceXML(wsdlsource, bytes));
            xsmodelList.add(xsGrammer.toXSModel());

        } else {
            Map schemas = serializeSchemaElements(doc);
            SchemaEntityResolver schemaResolver = (SchemaEntityResolver)preparser.getEntityResolver();
            schemaResolver.setSchemas(schemas);
            Iterator it = schemas.keySet().iterator();
            while (it.hasNext()) {
                String tns = (String)it.next();
                byte[] schemaBytes = (byte[])schemas.get(tns);
                WSDLSchemaErrorHandler schemaHandler = new WSDLSchemaErrorHandler(handler, schemaBytes, doc
                    .getXmlEncoding());

                try {
                    preparser.setErrorHandler(schemaHandler);

                    XSGrammar xsGrammer = (XSGrammar)preparser
                        .preparseGrammar(XMLGrammarDescription.XML_SCHEMA,
                                         copyInputSourceXML(wsdlsource, tns, schemaBytes, doc
                                             .getXmlEncoding()));
                    xsmodelList.add(xsGrammer.toXSModel());

                } finally {
                    preparser.setErrorHandler(handler);
                }
            }
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xerces.internal.xni.grammars.XSGrammar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.