Package com.ctc.wstx.stax

Examples of com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader()


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


        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

            +"1 2 3 4 5 61111 -9832<?pi?> 15\n\r <child /> <!-- yay   -->  4\n"
            + "</root>";

        int[] result = new int[20];

        TypedXMLStreamReader r = (TypedXMLStreamReader) f.createXMLStreamReader(new StringReader(xml));
        r.next();

        int count = r.readElementAsIntArray(result, 0, 20);

        System.out.println("Pass 1, Ints found: "+count);
View Full Code Here

            System.out.println(" #"+i+" -> "+result[i]);
        }
        r.close();

        // Then one by one:
        r = (TypedXMLStreamReader) f.createXMLStreamReader(new StringReader(xml));
        r.next();
        int index = 0;

        System.out.println("Pass 2, one by one access...");
        while (true) {
View Full Code Here

                    boolean hasDTD = false;
                    boolean hasExternalSubset = false;
                    boolean hasInternalSubset = false;
                    boolean hasEntityReferences = false;
                    try {
                        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StreamSource(
                                ConformanceTestFile.class.getResource(name).toString()));
                        while (reader.hasNext()) {
                            switch (reader.next()) {
                                case XMLStreamReader.DTD:
                                    hasDTD = true;
View Full Code Here

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

        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

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.