problem with <p> tag in transforming xml to wml

I have been trying to write an XSLT stylesheet that takes xml and
transforms it to wml.  A few problems occurred regarding the <p> tag.  The
process worked fine if the input xml is as follows:
                                                                                
<?xml version="1.0"?>
<p>
Some text to transform
<a>www.dcs.gla.ac.uk</a>
more text
</p>
                                                                                
However if I add anything after the </p> tag it causes an error when
processing "unexpected characters after document end".
The following stylesheet is being used:


<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
 <wml>
  <card id="no1" title="card1">
   <xsl:apply-templates/>
  </card>
 </wml>
</xsl:template>

<xsl:template match="p">
 <p>
 <xsl:apply-templates/>
 </p>
</xsl:template>

<xsl:template match="b">
 <b>
 <xsl:apply-templates/>
 </b>
</xsl:template>

<xsl:template match="i">
 <i>
 <xsl:apply-templates/>
 </i>
</xsl:template>

<xsl:template match="u">
 <u>
 <xsl:apply-templates/>
 </u>
</xsl:template>

<xsl:template match="large|x-large|xx-large">
 <big>
 <xsl:apply-templates/>
 </big>
</xsl:template>

<xsl:template match="small|x-small|xx-small">
 <small>
 <xsl:apply-templates/>
 </small>
</xsl:template>

<xsl:template match="em">
 <em>
 <xsl:apply-templates/>
 </em>
</xsl:template>

<xsl:template match="strong">
 <strong>
 <xsl:apply-templates/>
 </strong>
</xsl:template>

<xsl:template match="a">
 <a>
 <xsl:apply-templates/>
 </a>
</xsl:template>

<xsl:template match="br">
 <br/>
 <xsl:apply-templates/>
</xsl:template>

<xsl:template match="text">
 <p>
 <xsl:apply-templates/>
 </p>
</xsl:template>


</xsl:stylesheet>


Can anyone help??

Gillian Shields

Received on Tuesday, 24 February 2004 08:18:26 UTC