Altova Mailing List Archives

Re: [xsl] html:br

From: Wendell Piez <wapiez@---------------->
Date: 3/31/2003 1:08:00 PM

You can certainly do

<!DOCTYPE xsl:stylesheet [
<!ENTITY lb "&#xA;">

and then use


Just don't expect it to work differently from putting a literal in there.

You can also do

<!DOCTYPE xsl:stylesheet [
<!ENTITY lb "<xsl:text>&#xA;</xsl:text>">

but then


would expand to


which isn't allowed; in this case you'd use the entity outside any XSLT 
instructions, as in

<xsl:template match="element">
  <xsl:text>A line break:</xsl:text>

which would expand to

<xsl:template match="element">
  <xsl:text>A line break:</xsl:text>

Clearer yet?

This actually wouldn't be an XSL question at all except for the bit about 
whitespace-only nodes being stripped from the stylesheet outside the 
<xsl:text> instruction; to solve this puzzle you may have to get a grip on 
that issue separately from the issue of entity expansion. They're really 
separate issues, confused in this case by the fact that what you happen to 
want to represent in your entity, is whitespace (which is certainly okay to 
do, just not different from any other whitespace).


At 05:12 PM 3/31/2003, you wrote:
Hmmm... good point.
So there is no way to create an "entity" (or similar) of a line break
character then?

Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

XSL-List info and archive:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.