Yes, the DOM Level 3 LS API is implemented in Xerces, I am using it. Have a look at org.w3c.dom.ls.DOMBuilderFilter. It has the API for accepting Nodes while parsing. register it with any parser which implements rg.w3c.dom.ls.DOMBuilder, (in Xerces the parser you may use is org.apache.xerces.parsers.DOMBuilderImpl).

-Arno

Joseph Kesselman wrote:



What I'm trying to do is: when the parsing is finished, I scan the tree
and do node.removeChild(child) when child is a Text or Comment node. [...]
Is there a way to do that properly during the parsing? a feature to set?


The proposed DOM Level 3 load/save API included a filtering mechanism, last
time I looked at it. I don't know whether that's been implemented.

If not, the simplest answer is to set up a SAX filter which has this
effect, run a SAX parser into that, and run the filter's output into a
SAX-to-DOM builder. (Or apply that same concept at the XNI level; less
portable but more efficient, and you might be able to reuse some of the the
existing XNI components.)

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to