Package org.w3c.dom.ls

Examples of org.w3c.dom.ls.LSInput


            LSParser parser = getParser();
            try {
                if(ignoreBlanks) {
                    parser.setFilter(BLANK_FILTER);
                }
                LSInput ip = domImplementationLS.createLSInput();
                ip.setCharacterStream(reader);
                Document doc = parser.parse(ip);
                return doc;
            } finally {
                recycleParser(parser);
            }
View Full Code Here


    public void testSchemaOnClasspath()
    {
        final String type = "http://www.w3.org/2001/XMLSchema";
        final String systemId = "custom-type.xsd";
       
        LSInput lsInput = schemaResolver.resolveResource(type, "http://www.jboss.org/custom", null, systemId, null);
        Reader characterStream = lsInput.getCharacterStream();
        assertNotNull(characterStream);
    }
View Full Code Here

    {
        final String type = "http://www.w3.org/2001/XMLSchema";
       
        final String systemId = "http://www.jboss.org/esb/custom-type.xsd";
       
        LSInput lsInput = schemaResolver.resolveResource(type, "http://www.jboss.org/custom", null, systemId, null);
        assertNull(lsInput.getCharacterStream());
        assertNotNull(lsInput.getSystemId());
    }
View Full Code Here

  public LSInput resolveResource(final String type, final String namespace, final String publicId, final String systemId, final String baseURI)
  {
    try
    {
      final DOMImplementationLS impl = (DOMImplementationLS) DOMImplementationRegistry.newInstance().getDOMImplementation("LS");
      final LSInput dtdsource = impl.createLSInput();
      if (systemId.equals(this.dtdFileName))
      {
        dtdsource.setByteStream(new ByteArrayInputStream(this.dtdData));
        return dtdsource;
      }
    }
    catch (final Exception ex)
    {
View Full Code Here

//                              + "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

        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

                try {
                    XMLInputSource is = fEntityResolver.resolveEntity(
                        new XMLResourceIdentifierImpl(publicId,systemId,baseUri,null));
                    if(is==null)    return null;
                       
                    LSInput di = new DOMInputImpl();
                    di.setBaseURI(is.getBaseSystemId());
                    di.setByteStream(is.getByteStream());
                    di.setCharacterStream(is.getCharacterStream());
                    di.setEncoding(is.getEncoding());
                    di.setPublicId(is.getPublicId());
                    di.setSystemId(is.getSystemId());
                       
                    return di;
                } catch( IOException e ) {
                    // erors thrown by the callback is not supposed to be
                    // reported to users.
View Full Code Here

        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

         * 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

         * 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

TOP

Related Classes of org.w3c.dom.ls.LSInput

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.