Package com.ctc.wstx.stax

Examples of com.ctc.wstx.stax.WstxInputFactory


    int mType;

    private RunTypedSpeed(byte[] data)
    {
        mInputFactory = new WstxInputFactory();
        mInputFactory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
        mInputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
        // Just in case:
        mInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
        mIn = new ByteArrayInputStream(data);
View Full Code Here


        throws XMLStreamException
    {
        System.setProperty("javax.xml.stream.XMLInputFactory",
                           "com.ctc.wstx.stax.WstxInputFactory");

        XMLInputFactory f = new WstxInputFactory();

        String xml = "<root>"
            +"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);
        for (int i = 0; i < count; ++i) {
            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

                        ConformanceTestFile.class.getResourceAsStream("filelist")));
                List result = new ArrayList(10);
                // We make use of Woodstox' DTDInfo interface here, but we want to be able to use system properties
                // to specify the StAX implementation to be used by the tests. Therefore we need to create
                // an instance of the Woodstox InputFactory implementation directly.
                XMLInputFactory inputFactory = new WstxInputFactory();
                inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
                String name;
                while ((name = in.readLine()) != null) {
                    String resourceName = "org/apache/axiom/testutils/conformance/" + name;
                    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

        super(nameCoder);
    }

    @Override
    protected XMLInputFactory createInputFactory() {
        return new WstxInputFactory();
    }
View Full Code Here

    private XMLInputFactory inputFactory;
   
    public XMarshaler()
    {
        outputFactory = new WstxOutputFactory();
        inputFactory = new WstxInputFactory();
    }
View Full Code Here

     */
    boolean mFeatNsPrefixes = false;

    public WstxSAXParserFactory()
    {
        mStaxFactory = new WstxInputFactory();

        /* defaults should be fine... except that for some weird
         * reason, by default namespace support is defined to be off
         */
        setNamespaceAware(true);
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

    public TestAttrCollector() { super(); }

    public void testNsAttrCollector()
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        NsAttributeCollector ac = new NsAttributeCollector(f.getConfig());
        StringVector attrsIn = new StringVector(8);

        // !!! TBI
    }
View Full Code Here

    }

    public void testNonNsAttrCollector()
        throws XMLStreamException
    {
        WstxInputFactory f = getWstxInputFactory();
        NonNsAttributeCollector ac = new NonNsAttributeCollector(f.getConfig());

        // !!! TBI
    }
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

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.