users@jaxb.java.net

Comments, CDATA etc. with dom binding using a Lexical Handler

From: StopSpam <swajixa02_at_sneakemail.com>
Date: Tue, 05 Apr 2005 11:08:30 +0200

Dear all,

I'd like to be able to access xml comments, CDATA sections, Entities and
DTDs through
dom binding (<xjc:dom>).

So far I was successful in writing and registering my own Lexical
handler and to use it as follows.
[...]
InputStream is = .......;
saxParser saxParser = .......;
XMLReader xmlReader = saxParser.getXMLReader();
SAXSource source = new SAXSource(xmlReader, new InputSource(is));
xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler",
lexicalHandler);
Object o = unmarshaller.unmarshal(xmlReader, source);
[...]

My problem however is, that I cannot figure out how to get access to the
DOM node that is
the current element and thus going to be the parent for the comment node
that I want to create
using my lexical handler.

Is there a way to use customization or to extend the generated
W3CDOMUnmarshallingEventHandler
and to register it as a lexical handler as well to enable comments and
CDATA to be reflected in the
DOM tree generated by the dom binding (<xjc:dom>).

many thanks

Konrad Lanz
Konrad(dot)Lanz[AT]iaik{dot}at

P.S.: I posted this message again, because the previous one was posted
in reply to an old thread.
<https://jaxb.dev.java.net/servlets/BrowseList?list=users&by=thread&from=167031>