Package com.sun.xml.fastinfoset.sax

Examples of com.sun.xml.fastinfoset.sax.SAXDocumentParser


    /**
     * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
     */
    public void transform(InputStream source, ContentHandler target, TransformationContext context) {
        try {
            SAXDocumentParser parser = new SAXDocumentParser();
            parser.setContentHandler(target);
            parser.parse(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here


    /**
     * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
     */
    public void transform(InputStream source, ContentHandler target, TransformationContext context) {
        try {
            SAXDocumentParser parser = new SAXDocumentParser();
            parser.setContentHandler(target);
            parser.parse(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
     */
    public void transform(InputStream source, ContentHandler target, TransformationContext context) {
        try {
            SAXDocumentParser parser = new SAXDocumentParser();
            parser.setContentHandler(target);
            parser.parse(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
     */
    public void transform(InputStream source, ContentHandler target, TransformationContext context) {
        try {
            SAXDocumentParser parser = new SAXDocumentParser();
            parser.setContentHandler(target);
            parser.parse(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    /**
     * @see org.apache.tuscany.sca.databinding.PushTransformer#transform(java.lang.Object, java.lang.Object, org.apache.tuscany.sca.databinding.TransformationContext)
     */
    public void transform(InputStream source, ContentHandler target, TransformationContext context) {
        try {
            SAXDocumentParser parser = new SAXDocumentParser();
            parser.setContentHandler(target);
            parser.parse(source);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

        is.close();
    }
   
    private void readWithFI() throws TransformerConfigurationException, TransformerException, IOException {
        InputStream is = new FileInputStream(fiFile);
        XMLReader saxReader = new SAXDocumentParser();
        InputStream in = new BufferedInputStream(is);
        SAXSource saxSource = new SAXSource(saxReader, new InputSource(in));
        Document document;
        document = documentBuilder.newDocument();
        DOMResult domResult = new DOMResult(document);
View Full Code Here

    }

    public XMLReader getXMLReader() {
        XMLReader reader = super.getXMLReader();
        if (reader == null) {
            reader = new SAXDocumentParser();
            setXMLReader(reader);
        }
        ((SAXDocumentParser) reader).setInputStream(getInputStream());
        return reader;
    }
View Full Code Here

        document.mark(4);
        boolean isFastInfosetDocument = Decoder.isFastInfosetDocument(document);
        document.reset();
       
        if (isFastInfosetDocument) {
            SAXDocumentParser parser = new SAXDocumentParser();
            SAXEventSerializer ses = new SAXEventSerializer(events);
            parser.setContentHandler(ses);
            parser.setProperty(Properties.LEXICAL_HANDLER_PROPERTY, ses);
            parser.parse(document);
        } else {
            SAXParserFactory parserFactory = SAXParserFactory.newInstance();
            parserFactory.setNamespaceAware(true);
            SAXParser parser = parserFactory.newSAXParser();
            SAXEventSerializer ses = new SAXEventSerializer(events);
           
            XMLReader reader = parser.getXMLReader();
            reader.setProperty("http://xml.org/sax/properties/lexical-handler", ses);
            reader.setContentHandler(ses);
            if (workingDirectory != null) {
                reader.setEntityResolver(createRelativePathResolver(workingDirectory));
            }
View Full Code Here

TOP

Related Classes of com.sun.xml.fastinfoset.sax.SAXDocumentParser

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.