XmlCursor is the API designed to work with processing instructions and
comments, since these don't fit nicely within a JavaBean-like model.
Why do you want to avoid it? Inserting a new processing instruction is
as simple as finding the XmlObject before which you want the processing
instruction to appear and then calling
xmlObject.newCursor().insertProcInst(target, text);
Same thing about finding processing instructions - their targets are not
specified in Schema so they can't be known statically. You need to
navigate the document and extract them.
Radu
________________________________
From: alan s [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 23, 2008 12:25 PM
To: [email protected]
Subject: parsing comments/pi's
Any sample code to add comments and processing instructions
without using XmlCursor? i.e. may be using XmlObject- Couldn't find the
necessary apis here. Is there a way to retrieve these PIs(based on
Application targets ??) and comments during parsing (again, without
using XmlCursor)?
Thanks
Al
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or legally
privileged, and is intended solely for the use of the individual or entity
named in this message. If you are not the intended recipient, and have received
this message in error, please immediately return this by email and then delete
it.