logo       

Re: [xmlc] <br clear="none"></br>: msg#00007

java.enhydra.xmlc

Subject: Re: [xmlc] <br clear="none"></br>


Yep, you found the cause, even if you didn't understand it.

<!ATTLIST %br.qname;
clear ( left | all | right | none ) 'none'
>

That defines the default value for the "clear" attribute to be "none". The
parser sees this and fills it in. There's not a whole lot to do here.
Technically, the parser is absolutely correct and following the DTDs
instructions perfectly.

Oh, and I just remembered why it is printing out <br ...></br> instead of <br
/>. This is a result of the options.setXHTMLCompatiblity(true). This option
is meant for tags such as SCRIPT and STYLE. Some browsers don't deal with
<script/> and <style/> very well, and accept <script></script>, <style></style>
much better, even if there is no content inside those tags. But BR probably
shouldn't be treated the same way since its content model is always empty.
I'll have a look at the code tonight.

Can you do a test to see if <br clear="none" /> has the same browser
compatibility issues as <br clear="none"></br>? If it doesn't, then the fix is
to not include BR in the tags to apply the XHTML compatibility flag to. Oh,
also check that <br clear="none" /> and <br /> exhibit the same behavior. I'd
like to the leave the DTD alone.

Jake

Quoting Erik Rasmussen <rasmussenerik@xxxxxxxxx>:

>
> On Apr 16, 2007, at 6:21 PM, Jacob Kjome wrote:
> > I don't have time to check ATM, because I'm at work.
>
> It's a shame that you selfless OSS heroes have to have day jobs too.
>
> > However, can you look at
> > the DTD? Does it have default values defined for these
> > attributes? If so, the
> > parser is probably filling those in automagically.
>
> I don't speak DTD very fluently, but the relevant lines of xhtml.jar/
> org/enhydra/xml/xhtml/dtd/w3/1.1/xhtml11-flat.dtd seem to be:
>
> ---
> <!-- br: forced line break ............................. -->
>
> <!ENTITY % br.element "INCLUDE" >
> <![%br.element;[
>
> <!ENTITY % br.content "EMPTY" >
> <!ENTITY % br.qname "br" >
> <!ELEMENT %br.qname; %br.content; >
>
> <!-- end of br.element -->]]>
>
> <!ENTITY % br.attlist "INCLUDE" >
> <![%br.attlist;[
> <!ATTLIST %br.qname;
> %Core.attrib;
> >
> <!-- end of br.attlist -->]]>
> ---
>
> Sure looks like there isn't anything about a "clear" attribute
> there. Perhaps I'm looking in the wrong place?
>
> > Not sure what could be done
> > about that other than changing the DTD (which is feasible, since
> > XMLC contains
> > its own local copies of the DTD, but care would need to be taken
> > for any change
> > to a published DTD)
>
> The "clear" attribute is deprecated in the HTML4 spec. It wasn't
> deprecated in HTML3.2.
>
> > or having the user delete the attribute (which would be
> > annoying, I admit).
>
> Indeed.
>
> > As far as outputing <br ...></br> instead of <br .../>, that's
> > probably
> > something I can control in the serializer code. I'll try to look
> > into it
> > tonight. There's no reason it should be output with the former
> > format as BR's
> > content model is empty, at least as far as I am aware.
>
> The XHTML spec says, "Use the minimized tag syntax for empty
> elements, e.g. <br />, as the alternative syntax <br></br> allowed by
> XML gives uncertain results in many existing user agents."
>
> Oooh! I just found this:
> ---
> <!ATTLIST %br.qname;
> clear ( left | all | right | none ) 'none'
> >
> ---
> on this page: http://www.w3.org/TR/xhtml-modularization/
> dtd_module_defs.html
>
> I'm not familiar enough with XML and DTDs to know if the XHTML
> Modularization 1.1 DTD applies to XMLC and this particular problem.
>
> Did my research help at all? I can't say that it cleared things up
> any for me. :-(
>
> Thanks for your promptness,
> Erik
>
>
>
>





--
You receive this message as a subscriber of the xmlc@xxxxxxxxxxxxx mailing list.
To unsubscribe: mailto:xmlc-unsubscribe@xxxxxxxxxxxxx
For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise