Package com.sun.org.apache.xerces.internal.impl

Examples of com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl


    }
  }
 
  public static void staxCoursorParse() throws ParserConfigurationException, SAXException, IOException, XMLStreamException
  {
    XMLStreamReader staxCoursorImpl = new XMLStreamReaderImpl(new FileInputStream(xmlFile), new PropertyManager(1));
   
    int element = staxCoursorImpl.next();
    getEventTypeString(element);
    System.out.println(getEventTypeString(element));
    System.out.println(staxCoursorImpl.getLocalName());
   
//    staxCoursorImpl.getAttributeCount();
   
    while(staxCoursorImpl.hasNext())
    {
      element = staxCoursorImpl.next();
      System.out.println(getEventTypeString(element));
      if(element == XMLEvent.START_ELEMENT)
        System.out.println(staxCoursorImpl.getLocalName());
     
      if(element == XMLEvent.CHARACTERS)
        System.out.println(staxCoursorImpl.getText());
    }
   
    // Write file using StAX
//    XMLStreamWriter writer = new XMLStreamWriterImpl(new FileWriter(new File("src/modified_shipto.xml")), new PropertyManager(2));
//    writer.writeEmptyElement("EmtyTestElement");
View Full Code Here


        XMLInputSource inputSource = new XMLInputSource(null,systemId,null,reader,null);
        return getXMLStreamReaderImpl(inputSource);
    }
   
    public XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException {
        return new XMLStreamReaderImpl(jaxpSourcetoXMLInputSource(source),
                new PropertyManager(fPropertyManager));
    }
View Full Code Here

   
    XMLStreamReader getXMLStreamReaderImpl(XMLInputSource inputSource) throws javax.xml.stream.XMLStreamException{
        //1. if the temp reader is null -- create the instance and return
        if(fTempReader == null){
            fPropertyChanged = false;
            return fTempReader = new XMLStreamReaderImpl(inputSource,
                    new PropertyManager(fPropertyManager));
        }
        //if factory is configured to reuse the instance & this instance can be reused
        //& the setProperty() hasn't been called
        if(fReuseInstance && fTempReader.canReuse() && !fPropertyChanged){
            if(DEBUG)System.out.println("Reusing the instance");
            //we can make setInputSource() call reset() and this way there wont be two function calls
            fTempReader.reset();
            fTempReader.setInputSource(inputSource);
            fPropertyChanged = false;
            return fTempReader;
        }else{
            fPropertyChanged = false;
            //just return the new instance.. note that we are not setting  fTempReader to the newly created instance
            return fTempReader = new XMLStreamReaderImpl(inputSource,
                    new PropertyManager(fPropertyManager));
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl

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.