Package mf.javax.xml.transform.stream

Examples of mf.javax.xml.transform.stream.StreamSource


        InputStream inputStream;
        Reader reader;
        for (int i = 0; i < schemas.length; ++i) {
            Source source = schemas[i];
            if (source instanceof StreamSource) {
                StreamSource streamSource = (StreamSource) source;
                String publicId = streamSource.getPublicId();
                String systemId = streamSource.getSystemId();
                inputStream = streamSource.getInputStream();
                reader = streamSource.getReader();
                XMLInputSource xmlInputSource = new XMLInputSource(publicId, systemId, null);
                xmlInputSource.setByteStream(inputStream);
                xmlInputSource.setCharacterStream(reader);              
                xmlInputSources[i] = xmlInputSource;
            }
View Full Code Here


    }

    public void validate(Source source, Result result)
        throws SAXException, IOException {
        if (result instanceof StreamResult || result == null) {
            final StreamSource streamSource = (StreamSource) source;
            final StreamResult streamResult = (StreamResult) result;
            XMLInputSource input = new XMLInputSource(streamSource.getPublicId(), streamSource.getSystemId(), null);
            input.setByteStream(streamSource.getInputStream());
            input.setCharacterStream(streamSource.getReader());
           
            // Gets the parser configuration. We'll create and initialize a new one, if we
            // haven't created one before or if the previous one was garbage collected.
            boolean newConfig = false;
            XMLParserConfiguration config = (XMLParserConfiguration) fConfiguration.get();
View Full Code Here

     *
     * @throws SAXException If a SAX error occurs during parsing.
     * @throws NullPointerException if <code>schema</code> is null.
     */
    public Schema newSchema(File schema) throws SAXException {
        return newSchema(new StreamSource(schema));
    }
View Full Code Here

     *
     * @throws SAXException If a SAX error occurs during parsing.
     * @throws NullPointerException if <code>schema</code> is null.
     */
    public Schema newSchema(URL schema) throws SAXException {
        return newSchema(new StreamSource(schema.toExternalForm()));
    }
View Full Code Here

    public static InputSource sourceToInputSource(Source source) {

        if (source instanceof SAXSource) {
            return ((SAXSource) source).getInputSource();
        } else if (source instanceof StreamSource) {
            StreamSource ss      = (StreamSource) source;
            InputSource  isource = new InputSource(ss.getSystemId());

            isource.setByteStream(ss.getInputStream());
            isource.setCharacterStream(ss.getReader());
            isource.setPublicId(ss.getPublicId());

            return isource;
        } else {
            return null;
        }
View Full Code Here

TOP

Related Classes of mf.javax.xml.transform.stream.StreamSource

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.