[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Karl,
You can certainly do
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
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
which would expand to
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:
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Re: [xsl] html:br
Subject: Re: [xsl] html:br From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 31 Mar 2003 18:10:02 -0500 |
Karl,
You can certainly do
<!DOCTYPE xsl:stylesheet [ <!ENTITY lb "
"> ]>
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>
</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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] html:br, David Carlisle | Thread | [xsl]Passing Parameter to the URL u, Leonidas Kanellos |
[xsl] question on preceding nodes, Liao, John Teguh (Jo | Date | Re: [xsl] Re: generate full xpath n, Ray Tayek |
Month |