RE: including the HTML <BR> in XSL template

Subject: RE: including the HTML <BR> in XSL template
From: Toivo Lainevool <tlainevool@xxxxxxxxx>
Date: Wed, 26 Apr 2000 17:01:04 -0700 (PDT)
Use the HTML output method (ie. <xsl:output method="html"/>)

See the spec: http://www.w3.org/TR/xslt#section-HTML-Output-Method
which reads:
"The html output method should not output an end-tag for empty elements. For
HTML 4.0, the empty elements are area, base, basefont, br, col, frame, hr, img,
input, isindex, link, meta and param. For example, an element written as <br/>
or <br></br> in the stylesheet should be output as <br>."

Toivo Lainevool


--- Jay Marvin <jay.marvin@xxxxxxxxxxxxxx> wrote:
> Actually, your suggestion works in Internet Explorer but not Netscape.  The
> result from Xalan_1_0_1 is <BR/> (for both <BR/> and <BR></BR>), which
> Internet Explorer treats like <BR>, but Netscape ignores altogether.  Is
> there any way to get just a <BR> to come out?
> 
> -----Original Message-----
> From: Betty L. Harvey [mailto:harvey@xxxxxxxxxxxxxxxxx]
> Sent: Wednesday, April 26, 2000 8:24 PM
> To: 'XSL-List@xxxxxxxxxxxxxxxx'
> Subject: Re: including the HTML <BR> in XSL template
> 
> 
> 
> On Wed, 26 Apr 2000, Jay Marvin wrote:
> 
> > I would like to output a <BR> from a template, but am having trouble
> finding
> > the right way to do it.  What special way do I need to use to get these
> four
> > characters, "<BR>", out?   I understand it may involve wrapping it in
> > <xml:text>.
> > 
> > <xsl:template match="Line">
> > 	<xsl:value-of select="."/>
> > 	<BR>
> > </xsl:template>
> > 
> > 
> 
> XSL is XML compliant.  Empty elements (even HTML) have to
> be well-formed.  
> 
> This will work:
> 
> <xsl:template match="Line">
>        <xsl:value-of select="."/>
>        <BR/>
> </xsl:template>   
> 
> Either <BR/> or <BR></BR> will work.  This rule is also
> true for the <HR> and <IMG> HTML elements.
> 
> Betty
> 
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> Betty Harvey                         | Phone: 301-540-8251 
> Electronic Commerce Connection, Inc. |        410-787-9200 FAX: 9830
> 245 Hammarlee Road                   | 
> Glen Burnie, Md.  21060              |
> harvey@xxxxxxxxxx                    | Washington,DC SGML/XML Users Grp
> URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/  
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

__________________________________________________
Do You Yahoo!?
Talk to your friends online and get email alerts with Yahoo! Messenger.
http://im.yahoo.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread