logo       

Re: Enhydra: Re: xHTML problem again: msg#00008

java.enhydra.general

Subject: Re: Enhydra: Re: xHTML problem again

DocumentInfo is a XMLC interface, not a standard DOM. There is a way to create DocumentInfo from a DOM Document object. It's used GenericLinkedHTMLDocument to wrap the Document object and I think GenericLinkedHTMLDocument implements the DocumentInfo interface.

David


On Wednesday, Apr 2, 2003, at 16:34 Asia/Shanghai, Petr Stehlik wrote:

New information below:

On Út, 2003-04-01 at 13:58, Petr Stehlik wrote:
I have been trying to compile and produce valid XHTML 1.0 with Enhydra
5.0 for some time. I thought that everything was working OK but recently
I tried to use my own URLRewriter and it didn't work. So I traced it
down to

private static DocumentInfo BaseDOMFormatter:findDocumentInfo(Document
document)

This function checks the document (which is
org.enhydra.xml.xhtml.dom.xerces.XHTMLDocumentImpl) and finds out that
it's neither istanceof DocumentInfo nor instanceof XMLObjectLink. Thus
this function returns null as the DocumentInfo and thanks to that the
URLRewriter is ignored.

After several more hours of tracing I found out how the whole logic
works and I see at least two places that I could patch to fix the
problem. Now I'd need your advice which of the places is the correct
one:

1) DOMOps:getDocument() contains the following code:

if (node instanceof XMLObject) return node.getDocument()
else if (node instanceof Document) return node;

here I think that the XHTML should be treated more like a standard HTML
(which I believe goes the "instanceof Document" way) so perhaps
switching the order of the 'if' and 'elseif' would help?

2) the node.getDocument above calls XMLObjectImpl:getDocument() and that
one returns the fDocument that was created by XMLC in the compiled HTML
by the following functions:

org.enhydra.xml.xhtml.dom.xerces.XHTMLDocumentImpl document =
buildSubDocument();
setDocument(document,"text/html", "UTF-8");

The buildSubDocument() calls the following functions:

org.apache.xerces.dom.DocumentTypeImpl docType =
(org.apache.xerces.dom.DocumentTypeImpl)fDOMFactory.createDocumentType( "html", "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";, null);

org.enhydra.xml.xhtml.dom.xerces.XHTMLDocumentImpl document =
(org.enhydra.xml.xhtml.dom.xerces.XHTMLDocumentImpl)fDOMFactory.createD ocument("http://www.w3.org/1999/xhtml";, "html", docType);

Does the xerces parser support the DocumentInfo interface at all?

Petr


_______________________________________________
Enhydra mailing list
Enhydra@xxxxxxxxxxx
http://www.enhydra.org/mailman/listinfo.cgi/enhydra


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise