Examples of createXMLEventReader()


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

   * @throws XMLStreamException
   */
  public SBMLDocument readSBMLFromStream(InputStream stream, TreeNodeChangeListener listener)
      throws XMLStreamException {
    WstxInputFactory inputFactory = new WstxInputFactory();
    XMLEventReader xmlEventReader = inputFactory.createXMLEventReader(stream);
    return (SBMLDocument) readXMLFromXMLEventReader(xmlEventReader, listener);   
  }
 
  /**
   *
 
View Full Code Here

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

    case DOCUMENT: //filter the doc declaration
      XMLInputFactory inputFactory = XMLInputFactory.newInstance();
      if (!(r instanceof BufferedReader)) {
        r = new BufferedReader(r);
      }
      XMLEventReader eventReader = inputFactory.createXMLEventReader(r);
      eventReader = inputFactory.createFilteredReader(eventReader, new EventFilter() {
        @Override
        public boolean accept(XMLEvent event) {
          return !event.isStartDocument() && !event.isEndDocument();
        }
View Full Code Here

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

          throws ThreddsXmlParserException
  {
    try
    {
      XMLInputFactory factory = getFactory();
      XMLEventReader eventReader = factory.createXMLEventReader( source );

      ThreddsBuilderFactory catBuilderFac = new ThreddsBuilderFactoryImpl();
      ThreddsBuilder threddsBuilder = null;
      while ( eventReader.hasNext() )
      {
View Full Code Here

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

    Source source = new StreamSource( stringReader, docBaseUri.toString() );
    XMLInputFactory factory = XMLInputFactory.newInstance();
    factory.setProperty( "javax.xml.stream.isCoalescing", Boolean.TRUE );
    factory.setProperty( "javax.xml.stream.supportDTD", Boolean.FALSE );

    return factory.createXMLEventReader( source );
  }

  static void advanceReaderToFirstStartElement( XMLEventReader reader )
          throws XMLStreamException
  {
View Full Code Here

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

            throw Exceptions.sourceInstantiation(ex);
        }
        reader = getCharacterStreamImpl();

        try {
            eventReader = factory.createXMLEventReader(reader);
        } catch (XMLStreamException ex) {
            throw Exceptions.sourceInstantiation(ex);
        }

        try {
View Full Code Here

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

                       "com.bea.xml.stream.MXParserFactory");
    System.setProperty("javax.xml.stream.XMLEventFactory",
                       "com.bea.xml.stream.EventFactory");

    XMLInputFactory factory = XMLInputFactory.newInstance();
    XMLEventReader xmlr = factory.createXMLEventReader(new java.io.FileReader(args[0]));
   
    while(xmlr.hasNext()) {
      XMLEvent e = xmlr.nextEvent();
      System.out.println("["+
                         ElementTypeNames.getEventTypeString(e.getEventType())
View Full Code Here

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

    public void testXmlError() throws Exception {
        InputStream stream = new ByteArrayInputStream(
            "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><document>&lt;text&gt;</document>"
                .getBytes());
        XMLInputFactory factory = XMLInputFactory.newInstance();
        XMLEventReader reader = factory.createXMLEventReader(stream);
        StartDocument startdoc = (StartDocument) reader.nextEvent();
        assertEquals("UTF-8", startdoc.getCharacterEncodingScheme());
        assertEquals("1.0", startdoc.getVersion());
        assertTrue(reader.hasNext());
        XMLEvent event = reader.nextEvent();
View Full Code Here

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

    public void testXmlError2() throws Exception {
        InputStream stream = new ByteArrayInputStream(
            "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><document>&lt;text&gt; </document>"
                .getBytes());
        XMLInputFactory factory = XMLInputFactory.newInstance();
        XMLEventReader reader = factory.createXMLEventReader(stream);
        StartDocument startdoc = (StartDocument) reader.nextEvent();
        assertEquals("UTF-8", startdoc.getCharacterEncodingScheme());
        assertEquals("1.0", startdoc.getVersion());
        assertTrue(reader.hasNext());
        XMLEvent event = reader.nextEvent();
View Full Code Here

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

        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
        writer.write(fault, faultPart, evtWriter);
        LOG.log(Level.INFO, "Found exception in the raises list.  Marshalling.");
        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
        XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
        CorbaObjectHandler obj = corbaStaxObject.readObjectFromStax(evtReader, exIdlType);
        CorbaStreamable streamable = new CorbaStreamable(obj, elName);
        message.setStreamableException(streamable);
    }
View Full Code Here

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

                corbaStaxObject.writeObjectToStax(exStreamable.getObject(),
                                                  evtWriter,
                                                  XMLEventFactory.newInstance());
                evtWriter.flush();
                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
                FaultInfo fault = getFaultInfo(opInfo, elName);
                Object e = reader.read(fault.getMessageParts().get(0), evtReader);
                if (!(e instanceof Exception)) {
                    Class exClass = fault.getProperty(Class.class.getName(), Class.class);
                    Class beanClass = e.getClass();
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.