Examples of createXMLStreamReader()


Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

     ;

  public void setUp() throws XMLStreamException
  {
    XMLInputFactory factory = XMLInputFactory.newInstance();
    XMLStreamReader parser = factory.createXMLStreamReader(new java.io.StringReader(XML));
    a_iterator = SMInputFactory.hierarchicCursor(parser, SMFilterFactory.getElementOnlyFilter());
  }

  // The c_iterator reads A1B1C1
  // b_iterator is moved and reads A1B1C2 should read A1B2
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

            public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
                System.out.println("Error:" + errorType + ", message : " + message);
            }
        });
        try {
            return inputFactory.createXMLStreamReader(stringReader);
        } catch (XMLStreamException ex) {
            Exceptions.printStackTrace(ex);
        }
        return null;
    }
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

      }

      if (obj instanceof Node) {
        XMLInputFactory factory = _context.getXMLInputFactory();
        DOMSource source = new DOMSource((Node) obj);
        XMLStreamReader in = factory.createXMLStreamReader(source);

        StaxUtil.copyReaderToWriter(in, out);
       
        return;
      }
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

            StringReader strReader = new StringReader(src);
            XMLInputFactory xmlInFac = XMLInputFactory.newInstance();
            //Non-Coalescing parsing
            xmlInFac.setProperty("javax.xml.stream.isCoalescing", false);

            XMLStreamReader parser = xmlInFac.createXMLStreamReader(strReader);
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            return builder.getDocumentElement();
        }
    }
}
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

        XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
        xmlInputFactory.setProperty(XMLInputFactory.IS_COALESCING, true);
        xmlInputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true);
        XMLStreamReader stdXmlStreamReader =
            xmlInputFactory.createXMLStreamReader(this.getClass().getClassLoader().getResourceAsStream(
                "org/apache/xml/security/c14n/inExcl/plain-soap-1.1.xml"));

        //hmm why does a streamreader return a DOCUMENT_EVENT before we did call next() ??
        int stdXMLEventType = stdXmlStreamReader.getEventType();
        int secXMLEventType = xmlSecurityStreamReader.getEventType();
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

        return factory.createXMLStreamWriter(os);
    }
   
    public static XMLStreamReader createBadgerFishReader(InputStream is) throws XMLStreamException {
        XMLInputFactory factory = new BadgerFishXMLInputFactory();
        return factory.createXMLStreamReader(is);
    }
    //CHECKSTYLE:OFF   
    public static XMLStreamWriter createStreamWriter(OutputStream os,
                                                     QName qname,
                                                     boolean writeXsiType,
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

        }
       
        XMLInputFactory factory = depthProps != null
            ? new JettisonMappedReaderFactory(conf, depthProps)
            : new MappedXMLInputFactory(conf);
        return new JettisonReader(namespaceMap, factory.createXMLStreamReader(is));
    }
   
    private static class JettisonMappedReaderFactory extends MappedXMLInputFactory {
        private DocumentDepthProperties depthProps;
        public JettisonMappedReaderFactory(Configuration conf, DocumentDepthProperties depthProps) {
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

            encoding = "UTF-8";
        }

        XMLInputFactory factory = getXMLInputFactory();
        try {
            return factory.createXMLStreamReader(in, encoding);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Couldn't parse stream.", e);
        } finally {
            returnXMLInputFactory(factory);
        }
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

     * @param in
     */
    public static XMLStreamReader createXMLStreamReader(InputStream in) {
        XMLInputFactory factory = getXMLInputFactory();
        try {
            return factory.createXMLStreamReader(in);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Couldn't parse stream.", e);
        } finally {
            returnXMLInputFactory(factory);
        }
View Full Code Here

Examples of javax.xml.stream.XMLInputFactory.createXMLStreamReader()

        }
    }
    public static XMLStreamReader createXMLStreamReader(String systemId, InputStream in) {
        XMLInputFactory factory = getXMLInputFactory();
        try {
            return factory.createXMLStreamReader(systemId, in);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Couldn't parse stream.", e);
        } finally {
            returnXMLInputFactory(factory);
        }
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.