Error calling parseXML from Item

Hello

I have this agent in java, running locally. It is getting a regular text Item from a saved document. Then I am calling the method parseXML(false) from the item-object, to get the

org.w3c.dom.Document. But then the java console is showing this error:

[FATAL ERROR] notes:///__852570F3006C8E91.nsf/0/1473ED5C4318FA68852570F30076EDB1(IT) Line:1 Column:1: Invalid document structure.

Invalid document structure.

at com.ibm.xml.framework.XMLParser.handleError(Unknown Source)



at com.ibm.xml.framework.XMLParser.error(Unknown Source)



at com.ibm.xml.internal.DefaultScanner.emitError(Unknown Source)



at com.ibm.xml.internal.DefaultScanner.scanProlog(Unknown Source)



at com.ibm.xml.internal.DefaultScanner.scanDocument(Unknown Source)



at com.ibm.xml.framework.XMLParser.parse(Unknown Source)



at com.ibm.xml.parsers.NonValidatingDOMParser.parse(Unknown Source)



at lotus.domino.Parser.parse(Unknown Source)



at lotus.domino.local.Item.parseXML(Unknown Source)



at JavaAgent.NotesMain(JavaAgent.java:15)



at lotus.domino.AgentBase.runNotes(Unknown Source)



at lotus.domino.NotesThread.run(NotesThread.java:215)

Any ideas?

Thanks

Subject: error calling parseXML from Item

I found the problem. parseXML parses the content of the fieldThe field should contain XML code. I thought the method converted the field content to XML and then into a DOM.Document which is not the case.

If I want to convert the field to XML I need to call method generateXML from Notes Document object.