Examples of LSInput


Examples of org.w3c.dom.ls.LSInput

        throws XNIException, IOException {
        // resolve entity using DOM entity resolver
        if (fEntityResolver != null) {
            // For entity resolution the type of the resource would be  XML TYPE
            // DOM L3 LS spec mention only the XML 1.0 recommendation right now
            LSInput inputSource =
                resourceIdentifier == null
                    ? fEntityResolver.resolveResource(
                        null,
                        null,
                        null,
                        null,
                        null)
                    : fEntityResolver.resolveResource(
                        getType(resourceIdentifier),
                        resourceIdentifier.getNamespace(),
                        resourceIdentifier.getPublicId(),
                        resourceIdentifier.getLiteralSystemId(),
                        resourceIdentifier.getBaseSystemId());
            if (inputSource != null) {
                String publicId = inputSource.getPublicId();
                String systemId = inputSource.getSystemId();
                String baseSystemId = inputSource.getBaseURI();
                InputStream byteStream = inputSource.getByteStream();
                Reader charStream = inputSource.getCharacterStream();
                String encoding = inputSource.getEncoding();
                String data = inputSource.getStringData();

                /**
                 * An LSParser looks at inputs specified in LSInput in
                 * the following order: characterStream, byteStream,
                 * stringData, systemId, publicId.
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

         * returned into an <code>InputSource</code>.
         */
        public InputSource resolveEntity(String name, String publicId,
                String baseURI, String systemId) throws SAXException, IOException {
            if (fEntityResolver != null) {
                LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
                if (lsInput != null) {
                    final String pubId = lsInput.getPublicId();
                    final String sysId = lsInput.getSystemId();
                    final String baseSystemId = lsInput.getBaseURI();
                    final Reader charStream = lsInput.getCharacterStream();
                    final InputStream byteStream = lsInput.getByteStream();
                    final String data = lsInput.getStringData();
                    final String encoding = lsInput.getEncoding();

                    /**
                     * An LSParser looks at inputs specified in LSInput in
                     * the following order: characterStream, byteStream,
                     * stringData, systemId, publicId. For consistency
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

         * returned into an <code>InputSource</code>.
         */
        public InputSource resolveEntity(String name, String publicId,
                String baseURI, String systemId) throws SAXException, IOException {
            if (fEntityResolver != null) {
                LSInput lsInput = fEntityResolver.resolveResource(XML_TYPE, null, publicId, systemId, baseURI);
                if (lsInput != null) {
                    final String pubId = lsInput.getPublicId();
                    final String sysId = lsInput.getSystemId();
                    final String baseSystemId = lsInput.getBaseURI();
                    final Reader charStream = lsInput.getCharacterStream();
                    final InputStream byteStream = lsInput.getByteStream();
                    final String data = lsInput.getStringData();
                    final String encoding = lsInput.getEncoding();

                    /**
                     * An LSParser looks at inputs specified in LSInput in
                     * the following order: characterStream, byteStream,
                     * stringData, systemId, publicId. For consistency
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

            throw new ServiceRuntimeException(e);
        }
        DOMImplementation impl = registry.getDOMImplementation("XML 3.0");
        DOMImplementationLS ls = (DOMImplementationLS)impl.getFeature("LS", "3.0");
        LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, SCHEMA_NS);
        LSInput input = ls.createLSInput();
        input.setCharacterStream(new StringReader(schema));
        Document document = parser.parse(input);
        XSDefinition definition = factory.createXSDefinition();
        definition.setUnresolved(true);
        definition.setDocument(document);
        definition.setNamespace(ns);
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

            throw new ServiceRuntimeException(e);
        }
        DOMImplementation impl = registry.getDOMImplementation("XML 3.0");
        DOMImplementationLS ls = (DOMImplementationLS)impl.getFeature("LS", "3.0");
        LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, SCHEMA_NS);
        LSInput input = ls.createLSInput();
        input.setCharacterStream(new StringReader(schema));
        Document document = parser.parse(input);
        XSDefinition definition = factory.createXSDefinition();
        definition.setUnresolved(true);
        definition.setDocument(document);
        definition.setNamespace(ns);
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

            systemId = url.toString();
        } else if (url != null && systemId == null) {
            systemId = url.toString();
        }

        LSInput input = ls.createLSInput();
        input.setBaseURI(baseURI);
        input.setPublicId(publicId);
        input.setSystemId(systemId);
        return input;
    }
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

            throw new ServiceRuntimeException(e);
        }
        DOMImplementation impl = registry.getDOMImplementation("XML 3.0");
        DOMImplementationLS ls = (DOMImplementationLS)impl.getFeature("LS", "3.0");
        LSParser parser = ls.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, SCHEMA_NS);
        LSInput input = ls.createLSInput();
        input.setCharacterStream(new StringReader(schema));
        Document document = parser.parse(input);
        XSDefinition definition = factory.createXSDefinition();
        definition.setUnresolved(true);
        definition.setDocument(document);
        definition.setNamespace(ns);
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

        // resolve entity using DOM entity resolver
        if (fEntityResolver != null) {
            try {
                // For entity resolution the type of the resource would be  XML TYPE
                // DOM L3 LS spec mention only the XML 1.0 recommendation right now
                LSInput inputSource =
        resourceIdentifier == null ?
                    fEntityResolver.resolveResource(null, null, null, null, null) :
                    fEntityResolver.resolveResource( XML_TYPE, resourceIdentifier.getNamespace(), resourceIdentifier.getPublicId(), resourceIdentifier.getLiteralSystemId(), resourceIdentifier.getBaseSystemId());
                if (inputSource != null) {
                    String publicId = inputSource.getPublicId();
                    String systemId = inputSource.getSystemId();
                    String baseSystemId = inputSource.getBaseURI();
                    InputStream byteStream = inputSource.getByteStream();
                    Reader charStream = inputSource.getCharacterStream();
                    String encoding = inputSource.getEncoding();
                    XMLInputSource xmlInputSource =
                        new XMLInputSource(publicId, systemId, baseSystemId);
                    xmlInputSource.setByteStream((InputStream)byteStream);
                    xmlInputSource.setCharacterStream(charStream);
                    xmlInputSource.setEncoding(encoding);
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

//                              + "NAMESPACE_URI: "  + namespaceURI +  "\n"   
//                              + "PUBLIC_ID: "  + publicId +  "\n"  
//                              + "SYSTEM_ID: "  + systemId +  "\n"  
//                              + "BASE_URI: "  + baseURI +  "\n" ); 
             
            LSInput lsInput = new LSInputImpl()
             
            // In all Java EE schema xsd files, the <xsd:include schemaLocation=../> always reference to a relative path.
            // so the systemId here will be the xsd file name.
            URL schemaURL = JaxbJavaee.getSchemaURL(systemId);

            InputStream is = null;
            if (schemaURL!=null) {
                try {
                    is = schemaURL.openStream();
                } catch (IOException e) {
                    //should not happen
                    throw new RuntimeException(e);
                }
            }
                       
            lsInput.setSystemId(systemId)
            lsInput.setByteStream(is)
         
            return  lsInput; 
       
View Full Code Here

Examples of org.w3c.dom.ls.LSInput

        URL url = cachedXSDs.get(key);
        if (url != null) {
            systemId = url.toString();
        }

        LSInput input = ls.createLSInput();
        input.setBaseURI(baseURI);
        input.setPublicId(publicId);
        input.setSystemId(systemId);
        return input;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.