Examples of createXMLStreamReader()


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

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

        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

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

            +"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

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

            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

Examples of de.danet.an.util.sax.SAXContentBuffer.createXMLStreamReader()

  XMLReader reader = getReader();
  reader.setContentHandler(buf);
  reader.parse
      (new InputSource
       (Sax.class.getResourceAsStream("/util/testXPDL.xml")));
  XMLStreamReader rdr = buf.createXMLStreamReader();
  int event = 0;
  int sees = 0;
  int eees = 0;
  while (rdr.hasNext()) {
      event = rdr.next ();
View Full Code Here

Examples of de.danet.an.workflow.util.SAXEventBufferImpl.createXMLStreamReader()

      xr.setContentHandler (filter);
      xr.parse (new InputSource
          (new StringReader
           ("<temporary-root>" + xml + "</temporary-root>")));
      seb.pack();
      XMLStreamReader rdr = seb.createXMLStreamReader ();
      while (rdr.next () != XMLStreamReader.START_ELEMENT) {
      }
      if (rdr.getNamespaceURI().equals ("jelly:core")
    && rdr.getLocalName().equals ("jelly")) {
    return evalJelly (seb);
View Full Code Here

Examples of de.odysseus.staxon.json.JsonXMLInputFactory.createXMLStreamReader()

        Source source;
        try
        {
            if (inputs.getInputStream() != null)
            {
                source = new StAXSource(inputFactory.createXMLStreamReader(inputs.getInputStream(), enc == null ? "UTF-8" : enc));
            }
            else
            {
                source = new StAXSource(inputFactory.createXMLStreamReader(inputs.getReader()));
            }
View Full Code Here

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

    if (sourceClass == null || sourceClass == StreamSource.class) {
      return (T)new StreamSource(getBinaryStream(), this.getStreamFactory().getSystemId());
    } else if (sourceClass == StAXSource.class) {
      XMLInputFactory factory = XMLInputFactory.newInstance();
      try {
        return (T) new StAXSource(factory.createXMLStreamReader(getBinaryStream()));
      } catch (XMLStreamException e) {
        throw new SQLException(e);
      }
    } else if (sourceClass == SAXSource.class) {
      return (T) new SAXSource(new InputSource(getBinaryStream()));
View Full Code Here

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

  public static Type isXml(Reader reader) throws TransformationException {
    Type type = Type.ELEMENT;
    XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        try{       
             XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(reader);
             int event = xmlReader.getEventType();
           if  (event == XMLEvent.START_DOCUMENT && xmlReader.getLocation().getColumnNumber() != 1) {
             type = Type.DOCUMENT;
           }
             while (xmlReader.hasNext()) {
View Full Code Here

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

  public static String getEncoding(InputStream is) {
    XMLInputFactory factory = XMLInputFactory.newInstance();
    XMLStreamReader reader;
    try {
      reader = factory.createXMLStreamReader(is);
      return reader.getEncoding();
    } catch (XMLStreamException e) {
      return null;
    } finally {
      try {
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.