Altova Mailing List Archives


Re: [xsl] html:br

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



You can certainly do



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

and then use



<xsl:text>&lb;</xsl:text>



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



<xsl:text>&lb;</xsl:text>



would expand to



<xsl:text><xsl:text>&lb;</xsl:text></xsl:text>



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>
  &lb;
</xsl:template>

which would expand to



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

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).



Cheers,
Wendell

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?
Karl




======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
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:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

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 www.altova.com/list/index.html. 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.