Package javax.xml.stream

Examples of javax.xml.stream.XMLEventReader.nextEvent()


        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());       
        XMLEventReader evtReader = null;
        try {           
            evtReader = inputFactory.createXMLEventReader(inStream);
            // read the first tag which should be a start document
            XMLEvent evt = evtReader.nextEvent();
            assertTrue(evt.isStartDocument());
        } catch (XMLStreamException ex) {
        }
        assertNotNull(evtReader);
       
View Full Code Here


        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());       
        XMLEventReader evtReader = null;
        try {           
            evtReader = inputFactory.createXMLEventReader(inStream);
            // read the first tag which should be a start document
            XMLEvent evt = evtReader.nextEvent();
            assertTrue(evt.isStartDocument());
        } catch (XMLStreamException ex) {
        }
        assertNotNull(evtReader);
       
View Full Code Here

            InputStream in = read();
            XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
            // Read the XML document
            while (eventReader.hasNext())
            {
                XMLEvent event = eventReader.nextEvent();
                if (event.isStartElement())
                {
                    if (event.asStartElement().getName().getLocalPart().equals(TITLE))
                    {                 
                        event = eventReader.nextEvent();
View Full Code Here

                XMLEvent event = eventReader.nextEvent();
                if (event.isStartElement())
                {
                    if (event.asStartElement().getName().getLocalPart().equals(TITLE))
                    {                 
                        event = eventReader.nextEvent();
                        title = event.asCharacters().getData();
                        continue;
                    }
                    if (event.asStartElement().getName().getLocalPart().equals(LINK))
                    {                 
View Full Code Here

                        title = event.asCharacters().getData();
                        continue;
                    }
                    if (event.asStartElement().getName().getLocalPart().equals(LINK))
                    {                 
                        event = eventReader.nextEvent();
                        link = event.asCharacters().getData();
                        continue;
                    }
                }
                else if (event.isEndElement())
View Full Code Here

      InputStream in = new FileInputStream(sdmxFilePath);
      XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
     
      while (eventReader.hasNext())
      {
        XMLEvent event = eventReader.nextEvent();
        if (event.isStartElement())
        {
          StartElement startElement = event.asStartElement();
          // if the element is starting with <data:Series
          if (startElement.getName().getLocalPart() == "Series")
View Full Code Here

         XMLEventReader reader = xmlInputFactory.createXMLEventReader(stream);

         // parse the complete document
         while (reader.hasNext()) {

            XMLEvent event = reader.nextEvent();

            // this events means we can abort
            if (event.isEndDocument()) {
               break;
            }
View Full Code Here

            // ensure UTF-8 encoding
            Exchange exchange = new DefaultExchange(context);
            exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.toString());
            writer = context.getTypeConverter().mandatoryConvertTo(XMLEventWriter.class, exchange, output);
            while (reader.hasNext()) {
                writer.add(reader.nextEvent());
            }
        } finally {
            if (reader != null) {
                reader.close();
            }
View Full Code Here

            // ensure UTF-8 encoding
            Exchange exchange = new DefaultExchange(context);
            exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.toString());
            writer = context.getTypeConverter().mandatoryConvertTo(XMLEventWriter.class, exchange, output);
            while (reader.hasNext()) {
                writer.add(reader.nextEvent());
            }
        } finally {
            if (reader != null) {
                reader.close();
            }
View Full Code Here

      XMLEventReader reader =
         factory.createXMLEventReader(PrivilegedFileHelper.fileInputStream(bindingsStorePath), "UTF-8");

      while (reader.hasNext())
      {
         XMLEvent event = reader.nextEvent();
         switch (event.getEventType())
         {
            case XMLStreamConstants.START_ELEMENT :
               StartElement startElement = event.asStartElement();
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.