First of all sorry for cross posting. When I navigate through an xml object using the Xml Beans cursor I sometimes get an element that contains an <xml-fragment ... element.
I not sure if it is a bug in Xml Beans or not. (though it appears as one) So I'm posting a few questions: 1. Why is an <xml-fragment element returned even though it is not defined in the xml I loaded? 2. How can I know whether the xml object element is an xml-fragment element without performing a toString on the xml object? 3. Since I'm interested in the element defined in the real xml document and not in the xml-fragment element, how can I get to it? Thanks in advance, Asaf _____ From: Asaf Lahav [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 7:13 PM To: '[EMAIL PROTECTED]' Subject: Navigating through XmlObject with cursor Trying to navigate through an XmlObject using a cursor I've come up with the following code: 1) XmlObject xyzDocument = XmlObject.Factory.parse(new File("c:/xyz.xml")); 2) System.out.println(xyzDocument); 3) XmlCursor cursor = xyzDocument.newCursor(); 4) if(cursor.toFirstChild()) { 5) System.out.println(cursor.getObject()); 6) while(cursor.toNextSibling()) { 7) System.out.println(cursor.getObject()); 8) } 9) } 10) cursor.dispose(); 11) } catch (Exception e) { 12) e.printStackTrace(); 13) } The problem is that after I call the 'toFirstChild' in line 4 I get an element with the name: <xml-fragment ... when I print it on line 5. What would be the right way to navigate through an un-typed xml object?