Package com.ctc.wstx.stax

Examples of com.ctc.wstx.stax.WstxInputFactory


        XMLStreamWriter writer = STAXUtils.createXMLStreamWriter(new ByteArrayOutputStream(), null, ctx);
    }
   
    public void testWSTX() throws Exception
    {
        ifactory = new WstxInputFactory();
        ofactory = new WstxOutputFactory();

        doCopy();
        doSkipTest();
        doNameSpaceDoc();
View Full Code Here


     * and introspection via SAX classes (as opposed to JAXP-based
     * introspection).
     */
    public WstxSAXParser()
    {
        this(new WstxInputFactory(), FEAT_DEFAULT_NS_PREFIXES);
    }
View Full Code Here

        return (WstxInputFactory) getInputFactory();
    }

    protected static XMLInputFactory2 getNewInputFactory()
    {
        return new WstxInputFactory();
    }
View Full Code Here

        }
        sb.append("</a>");

        // And then we'll parse to ensure line numbers and offsets are ok
       
        WstxInputFactory f = getWstxInputFactory();
        // Need to shrink it to get faster convergence
        f.getConfig().setInputBufferLength(23);
        XMLStreamReader2 sr = (XMLStreamReader2) f.createXMLStreamReader(new StringReader(sb.toString()));

        assertTokenType(START_ELEMENT, sr.next());

        int linenr = 1;
        int col = 4;
View Full Code Here

        StringBuffer inputBuf = new StringBuffer();
        StringBuffer expOut = new StringBuffer();
        generateData(new Random(123), inputBuf, expOut, true);
        String inputStr = inputBuf.toString();

        WstxInputFactory f = getWstxInputFactory();
        // Should shrink it to get faster convergence
        f.getConfig().setInputBufferLength(17);
        f.getConfig().doCoalesceText(coal);
        XMLStreamReader2 sr = (XMLStreamReader2) f.createXMLStreamReader(new StringReader(inputStr));

        int lastLine = 0;
        int lastOffset = 0;

        while (sr.next() != XMLStreamConstants.END_DOCUMENT) {
View Full Code Here

         * specific String.
         */
        String baseArgStr = "ns: "+ns+", coalesce: "+coalescing+", entityExp: "+autoEntity;
        long seed = baseArgStr.hashCode();

        WstxInputFactory f = (WstxInputFactory) getInputFactory();
        ReaderConfig cfg = f.getConfig();

        // Settings we always need:
        cfg.doSupportDTDs(true);
        cfg.doValidateWithDTD(false);

View Full Code Here

     */

    private XMLStreamReader getReader(String contents, boolean nsAware)
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        f.getConfig().doValidateWithDTD(false);
        f.getConfig().doSupportNamespaces(nsAware);
        return constructStreamReader(f, contents);
    }
View Full Code Here

    }

    private XMLStreamReader getValidatingReader(String contents, boolean nsAware)
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        f.getConfig().doSupportNamespaces(nsAware);
        f.getConfig().doSupportDTDs(true);
        f.getConfig().doValidateWithDTD(true);
        return constructStreamReader(f, contents);
    }
View Full Code Here

    private XMLStreamReader getReader(String contents, boolean prologWS,
                                      boolean lazyParsing)
        throws XMLStreamException
    {
        WstxInputFactory f = (WstxInputFactory) getInputFactory();
        ReaderConfig cfg = f.getConfig();
        cfg.doReportPrologWhitespace(prologWS);
        cfg.doParseLazily(lazyParsing);
        return constructStreamReader(f, contents);
    }
View Full Code Here

     */

    private XMLStreamReader2 getReader(String contents, boolean coalesce)
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        f.getConfig().doSupportNamespaces(true);
        f.getConfig().doCoalesceText(coalesce);
        f.getConfig().setInputBufferLength(16);
        f.getConfig().setShortestReportedTextSegment(4);
        return constructStreamReader(f, contents);
    }
View Full Code Here

TOP

Related Classes of com.ctc.wstx.stax.WstxInputFactory

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.