users@jaxb.java.net

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

From: StopSpam <swajixa02_at_sneakemail.com>
Date: Sun, 03 Apr 2005 20:39:17 +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 saxParse = .......r
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