users@glassfish.java.net

Re: JSP/JSF and XML

From: <glassfish_at_javadesktop.org>
Date: Fri, 20 Apr 2007 11:20:55 PDT

hi, I'm having an issue here using StAX

I am using netbean 5.5.1 and glassfish v2

where can I find to add the lib file for Jaxp 1.3 into netbean?

It is complaining imcompatible type

Compiling 1 source file to D:\netbeans-5.5.1rc1\wkspace\TestReport\build\web\WEB-INF\classes
D:\netbeans-5.5.1rc1\wkspace\TestReport\src\java\com\TestReport\StAXParseByEvent.java:35: incompatible types
found : java.lang.Object
required: javax.xml.stream.events.XMLEvent
         XMLEvent e = r.next();


my code:
    public static void main(String[] args) throws FileNotFoundException, XMLStreamException {
      // Use the reference implementation for the XML input factory
      //System.setProperty("javax.xml.stream.XMLInputFactory", "com.bea.xml.stream.MXParserFactory");
      // Create the XML input factory
      XMLInputFactory factory = XMLInputFactory.newInstance();
      // Create the XML event reader
      FileReader reader = new FileReader("somefile.xml");
      XMLEventReader r = factory.createXMLEventReader(reader);
      // Loop over XML input stream and process events
      while(r.hasNext()) {
         XMLEvent e = r.next();
         processEvent(e);
      }
    }
[Message sent by forum member 'arckjmaster' (arckjmaster)]

http://forums.java.net/jive/thread.jspa?messageID=213450