You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Will Holcomb <wh...@gmail.com> on 2007/02/22 19:45:51 UTC

possible error in the faq

In the FAQ: http://xerces.apache.org/xerces2-j/faq-dom.html#faq-2

The example imports org.w3c.dom.DOMImplementationRegistry. This class
doesn't seem to exist and, as best I can tell, should be
org.w3c.dom.bootstrap.DOMImplementationRegistry.

Is that correct?

Will Holcomb

P.S. I am trying to load XHTML document fragments that don't have a doctype.
The parser is bitching about the undefined entities. I'm still trying to
figure it out on my own, but it would be amazingly useful if anyone knows
off the top of their head how to either:

1. Pass entities through a parse unresolved. It seems like they could just
stay entities the entire time and be written as entities in the output
without ever having been resolved.
2. Preload the HTML default character entities into a parser before setting
it up to parse.
3. Some other solution that I haven't thought of. The goal is to not have to
edit the hundreds of source documents.

Re: possible error in the faq

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
"Will Holcomb" <wh...@gmail.com> wrote on 02/22/2007 01:45:51 PM:

> In the FAQ: http://xerces.apache.org/xerces2-j/faq-dom.html#faq-2
> 
> The example imports org.w3c.dom.DOMImplementationRegistry. This 
> class doesn't seem to exist and, as best I can tell, should be org.
> w3c.dom.bootstrap.DOMImplementationRegistry.
> 
> Is that correct?

Yes. Good catch. I just fixed it in SVN. Should be up on the website the 
next time we refresh it.

> Will Holcomb
> 
> P.S. I am trying to load XHTML document fragments that don't have a 
> doctype. The parser is bitching about the undefined entities. I'm 
> still trying to figure it out on my own, but it would be amazingly 
> useful if anyone knows off the top of their head how to either: 
> 
> 1. Pass entities through a parse unresolved. It seems like they 
> could just stay entities the entire time and be written as entities 
> in the output without ever having been resolved.
> 2. Preload the HTML default character entities into a parser before 
> setting it up to parse. 
> 3. Some other solution that I haven't thought of. The goal is to not
> have to edit the hundreds of source documents.

If you were using a DocumentBuilder you could provide the entity 
declarations with an implementation of EntityResolver2 [1]. See 
getExternalSubset().

[1] 
http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/ext/EntityResolver2.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: possible error in the faq

Posted by ke...@us.ibm.com.
>The example imports org.w3c.dom.DOMImplementationRegistry.

That API name changed between the working draft and the final DOM Level 3
spec. The current name is indeed
org.w3c.dom.bootstrap.DOMImplementationRegistry, and the example should be
updated.

See http://www.w3.org/TR/DOM-Level-3-Core/java-binding.html#java-binding


______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev-11.html)