Re: XMLC, setEnableXTHMLCompatibilty

David Corbin <[email protected]> Tue, 7 Oct 2003 16:53:46 -0400
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
On Tuesday 07 October 2003 12:39, Jacob Kjome wrote:
> At 09:15 AM 10/7/2003 -0700, you wrote:
> > >But what I see happening, is that when I generate XHTML like this:
> > >
> > >--snip--
> > ><div>
> > >        Title
> > >        <div class="foo" />
> > >        More content
> > ></div>
> > >Final Content
> > >--end--
> > >
> > >--snip--
> > >I get very different results than when I generate
> > >
> > ><div>
> > >        Title
> > >        <div class="foo" ></div>
> > >        More content
> > ></div>
> > >--end--
> > >
> > >Essentially, the browser is ignoring the implcit end of the second div.
> >
> >Here's a relevant page from WC3 about this.
> >
> >http://www.w3.org/TR/xhtml1/#C_3
> >
> >-Justin
>
> Ok, this is what I thought.  There never should be a <div/> or <p/>.  So,
> David, are you supplying <div/> in your tempate or are you removing the
> text node and then then XMLC's XMLFormatter is outputing <div/>???  

It's happening in MANY different places in our code, and I'm not sure if I 
could tell you that we have a uniform cause.   But I can say that if we put 
in a <div /> in the template, the problem happens.  I do know we do that in 
some places.  Regardless, it's definately the XMLFormatter that is writing 
out <div /> (I think regardless of how it happens, if you have 
XHTMLDivElement with no children, you'll get "<div/>".

> How common is this?  

Common enough in our app.

> If XMLC is doing it, then that should probably be added to
> the setXHTMLCompatibility() stuff.


Exactly.  EVERYTHING that can have a close tag in HTML should be in that list.
>
> BTW, what difference are you seeing in the display?  That is, what do you
> mean by "ignoring the implicit end"?  And when you say "the browser", do
> you mean IE, Mozilla, or both?
>

Both browsers do it in exactly the same way (which was really scary).  
Literally, they treat <div /> as if it were <div>  This makes other </div> 
mistmatch and your nesting gets way off, until the browsers "self-correct" 
and say "oh he must have meant you to put a </div> here, because he's got an 
open <div> and I just found </body>

If you take the Bug.html snippet I sent in another message, and open it up, 
View-Source will show you what the file is, but if you save that from the 
browser, the <div /> gets translated into  <div>  (kind of an insight into 
how the browser is seeing the content.


> Jake
>
>
> _______________________________________________
> XMLC mailing list
> [email protected]
> http://www.enhydra.org/mailman/listinfo.cgi/xmlc