This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: matching <br/> v. <br></br>
Sorry That was not clear enough and perhaps misleading. Here is a
reproducible set of XSL and XML.
Note that when the para's are enclosed in a span with a font class this
behavior happens. But when the span is removed the output of the <br></br>
is passed through to be seen by a user:
XML (run in coocon or command line with Xalan)
=======================================
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<?cocoon-process type="xslt"?>
<test>
<para>kjdsf sdlfkjf lsls dflflk sg <br/> jdflk dfkldf lsl dfklgj skl
</para>
<para>kjdsf sdlfkjf lsls dflflk sg <br></br> jdflk dfkldf lsl dfklgj skl
</para>
<para>Holly and Jeff<br/> received some<br></br> training
manuals<br></br> they ordered.</para>
</test>
--------------------------------------------------------------
XSL
=========================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="test">
<html>
<head>
<style>
.test {}
</style>
<title></title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="para">
<xsl:for-each select=".">
<span class="test">
<xsl:apply-templates/>
</span>
<hr/>
</xsl:for-each>
</xsl:template>
<xsl:template match="br | BR">
<br/>
</xsl:template>
</xsl:stylesheet>
----- Original Message -----
From: "Robert Koberg" <rob@koberg.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Wednesday, January 31, 2001 12:21 PM
Subject: [xsl] matching <br/> v. <br></br>
> (using Xalan)
>
> I have a basic template like so:
>
> <xsl:template match="br | BR">
> <br/>
> </xsl:template>
>
> If the XML contains just a <br/> tag it styles correctly with a single
<br>.
> If the XMl contains <br></br> then it produces two <br><br>.
>
> Is this a bug or expected behavior? Is there a way around it?
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list