Subject: RE: [xsl] how to match <br/> tag From: Jeff Beadle <Jbeadle@xxxxxxxx> Date: Thu, 27 Jun 2002 13:29:08 -0400 |
David, Thanks for the correction/clarification. I guess back when we began moving all of our html to xhtml (Transitional), I remember encountering this issue. I thought I remembered seeing this (<br></br>) barf when we used the W3C validator tool. But it must have been the I.E. 4 browser we were using or something. I'm sure to no surprise for you, but the xhtml spec actually makes a reference to same thing you did, about how the browser may have issues with the non-abbreviated form of "br": "C.2 Empty Elements" [http://www.w3.org/TR/xhtml1/#guidelines] Include a space before the trailing / and > of empty elements, e.g. <br />, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, 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. As always, thanks for sharing your expertise and quickly correcting my misguidance. Jeff -----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: Thursday, June 27, 2002 11:46 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] how to match <br/> tag > "<br/> is a short form of <br></br>" > > But, be advised that thinking any element with no descendant elements can be > expressed this way, becase that's not true ... especially in the case of the > xhtml:br and possibly the html:{BR | Br | bR | br} element. > > Being able to express an element in the abbreviated manner is totally > dependant on the intent of the given elements schema. > > In this case, xhtml:br or html:{BR | Br | bR | br} is an empty element, it > cannot have any attributes or descendant entities as <br></br> does, which > has one (empty) text node. > > So, with respect to xhtml or html, "br" cannot be of the form <br></br>, it > must be (ignoring casing/namespace) <br />. > > Because, <br></br> will not validate against the xhtml schema ... it may be > ok against the highly tolerant html schema--but, I'm not sure. > > -Jeff No this is wrong. <xxx/> is in _all_ circumstances identical to <xxx></xxx> in XML irrespective of DTD or schema declarations. This equivalence is clearly explicit in teh XML specification. Some browsers can not cope with <br></br> but that is because the do not parse XML and only tolerate it because they try to parse the XML as HTML they silently ignore parse errors. No DTD or schema validator (or XSLT processor) can distinguish <br/> from <br></br>. David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] how to match <br/> tag, Andrew Welch | Thread | Re: Re: [xsl] how to match <br/> ta, ashu t |
RE: [xsl] XSL -XML to XSL reorienti, Chris Bayes | Date | Re: [xsl] XSL -XML to XSL reorienti, Mike Ferrando |
Month |