This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
whitespace before the trailing slash
- To: xsl-list at mulberrytech dot com
- Subject: whitespace before the trailing slash
- From: "Carole E. Mah" <carole at goon dot stg dot brown dot edu>
- Date: Fri, 3 Mar 2000 09:56:45 -0500 (EST)
- Reply-To: xsl-list at mulberrytech dot com
Hello,
I'm hoping someone can help me here. I'm writing an xsl stylesheet and
so far have only installed XT to process it.
Whitespace before the trailing slash in an empty element is optional in
XML, e.g. <hr/> or <hr />. However, I always want to have that whitespace
there, and my source.xml or sourc.html documents may often already have
them (e.g. if you run your document through Tidy first, with -asxml as an
option, Tidy puts in the whitespace: e.g. <br />).
Since one cannot use <xsl:text> around elements, the following is
illegal:
<xsl:template match="foo">
<xsl:text><xsl:copy-of select="."/></xsl:text>
</xsl:template>
and the following is also illegal:
<xsl:template match="foo">
<xsl:text><foo /></xsl:text>
</xsl:template>
Furthermore, sine whitespace within an xsl stylesheet is considered
insignificant, this merely produces <foo/>, as the whitespace gets
stripped:
<xsl:templete match="foo">
<foo />
</xsl:template>
Any suggestions? Thanks,
-carole
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Carole E. Mah Carole_Mah@Brown.edu
Programmer/Analyst
Brown University
Scholarly Technology Group
phn 401-863-2669
fax 401-863-9313
http://www.wwp.brown.edu/
personal: http://www.wwp.brown.edu/~carolem/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list