Examples of XMLInputSource


Examples of com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource

        return copyInputSourceXML(source, stream, source.getEncoding());
    }

    private XMLInputSource copyInputSourceXML(InputSource source, byte[] stream, String encoding) {

        XMLInputSource ret = null;
        if (stream == null) {
            ret = new XMLInputSource(source.getPublicId(), source.getSystemId(), null);
        } else {
            ret = new XMLInputSource(source.getPublicId(), source.getSystemId(), null,
                                     new ByteArrayInputStream(stream), encoding);
        }
        return ret;
    }
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource

    }

    private XMLInputSource copyInputSourceXML(InputSource source, String tns,
                                              byte[] stream, String encoding) {

        XMLInputSource ret = null;
        if (stream == null) {
            ret = new XMLInputSource(source.getPublicId(), source.getSystemId(), null);
        } else {
            ret = new XMLInputSource(tns, tns, null, new ByteArrayInputStream(stream), encoding);
        }
        return ret;
    }
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource

                    String msg = "Can't resolve entity from publicID=" + id.getPublicId() + ", systemID="
                                 + id.getLiteralSystemId();

                    throw new IOException(msg);
                }
                return new XMLInputSource(id.getPublicId(), url, id.getBaseSystemId());
            } else {
                // Means the schema is in the same wsdl document
                String ns = id.getNamespace();
                byte[] schemaBytes = (byte[])schemas.get(ns);
                if (schemaBytes != null) {
                    return new XMLInputSource(id.getPublicId(), id.getLiteralSystemId(),
                                              id.getBaseSystemId(), new ByteArrayInputStream(schemaBytes),
                                              "UTF-8");
                } else {
                    return null;
                }
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource

                    String systemId = inputSource.getSystemId();
                    String baseSystemId = resourceIdentifier.getBaseSystemId();
                    InputStream byteStream = inputSource.getByteStream();
                    Reader charStream = inputSource.getCharacterStream();
                    String encoding = inputSource.getEncoding();
                    XMLInputSource xmlInputSource =
                        new XMLInputSource(publicId, systemId, baseSystemId);
                    xmlInputSource.setByteStream(byteStream);
                    xmlInputSource.setCharacterStream(charStream);
                    xmlInputSource.setEncoding(encoding);
                    return xmlInputSource;
                }
            }

            // error resolving entity
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource

    public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
        throws XNIException, IOException {

        String resolvedId = resolveIdentifier(resourceIdentifier);
        if (resolvedId != null) {
            return new XMLInputSource(resourceIdentifier.getPublicId(),
                                      resolvedId,
                                      resourceIdentifier.getBaseSystemId());
        }
        return null;
    }
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource

        String systemId = source.getSystemId();
        String baseSystemId = baseURI;
        InputStream byteStream = source.getByteStream();
        Reader charStream = source.getCharacterStream();
        String encoding = source.getEncoding();
        XMLInputSource xmlInputSource =
            new XMLInputSource(publicId, systemId, baseSystemId);
        xmlInputSource.setByteStream(byteStream);
        xmlInputSource.setCharacterStream(charStream);
        xmlInputSource.setEncoding(encoding);
        return xmlInputSource;
       
    } // createXMLInputSource(InputSource,String):XMLInputSource
View Full Code Here

Examples of mf.org.apache.xerces.xni.parser.XMLInputSource

                            break;
                        }
                        case SCANNER_STATE_DTD_EXTERNAL: {
                            fDTDDescription.setValues(fDoctypePublicId, fDoctypeSystemId, null, null);
                            fDTDDescription.setRootName(fDoctypeName);
                            XMLInputSource xmlInputSource =
                                fEntityManager.resolveEntity(fDTDDescription);
                            fDTDScanner.setInputSource(xmlInputSource);
                            setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
                            again = true;
                            break;
View Full Code Here

Examples of mf.org.apache.xerces.xni.parser.XMLInputSource

        protected void resolveExternalSubsetAndRead()
            throws IOException, XNIException {
           
            fDTDDescription.setValues(null, null, fEntityManager.getCurrentResourceIdentifier().getExpandedSystemId(), null);
            fDTDDescription.setRootName(fElementQName.rawname);
            XMLInputSource src = fExternalSubsetResolver.getExternalSubset(fDTDDescription);
           
            if (src != null) {
                fDoctypeName = fElementQName.rawname;
                fDoctypePublicId = src.getPublicId();
                fDoctypeSystemId = src.getSystemId();
                // call document handler
                if (fDocumentHandler != null) {
                    // This inserts a doctypeDecl event into the stream though no
                    // DOCTYPE existed in the instance document.
                    fDocumentHandler.doctypeDecl(fDoctypeName, fDoctypePublicId, fDoctypeSystemId, null);
View Full Code Here

Examples of mf.org.apache.xerces.xni.parser.XMLInputSource

                /**
                 * An LSParser looks at inputs specified in LSInput in
                 * the following order: characterStream, byteStream,
                 * stringData, systemId, publicId.
                 */         
                XMLInputSource xmlInputSource =
                    new XMLInputSource(publicId, systemId, baseSystemId);
               
                if (charStream != null) {
                    xmlInputSource.setCharacterStream(charStream);
                }
                else if (byteStream != null) {
                    xmlInputSource.setByteStream((InputStream) byteStream);
                }
                else if (data != null && data.length() != 0) {
                    xmlInputSource.setCharacterStream(new StringReader(data));
                }
                xmlInputSource.setEncoding(encoding);
                return xmlInputSource;
            }
        }

        // unable to resolve entity
View Full Code Here

Examples of mf.org.apache.xerces.xni.parser.XMLInputSource

        String systemId = source.getSystemId();
        String baseSystemId = baseURI;
        InputStream byteStream = source.getByteStream();
        Reader charStream = source.getCharacterStream();
        String encoding = source.getEncoding();
        XMLInputSource xmlInputSource =
            new XMLInputSource(publicId, systemId, baseSystemId);
        xmlInputSource.setByteStream(byteStream);
        xmlInputSource.setCharacterStream(charStream);
        xmlInputSource.setEncoding(encoding);
        return xmlInputSource;
       
    } // createXMLInputSource(InputSource,String):XMLInputSource
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.