RE: < and >

Subject: RE: < and >
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 29 Apr 1999 11:38:32 +0100

> -----Original Message-----
> From: Sharmila Pandith [mailto:sharmila@xxxxxxxxx]
> Sent: 28 April 1999 22:45
> To: XSL List
> Subject: < and >
> 
> 
> Hi,
> 
> I am using XSL to transfer one form to XSL to an other.
> For Ex:
> If I have
> <Advertisement>
> 	<advertiser>
> 		<name>Ross Gheller</name>
> 	</advertiser>
> </Advertisement>
> 
> should transform to:
> <adex>
> 	<ad-info>
> 		<name>Ross Gheller</name>
> 	</ad-info>
> </adex>
> 
> The way I am doing right now is:
> <?xml version="1.0" ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
> 
> <!--  Root xsl:template - start processing here -->
> <xsl:template match="/">
> 	<xsl:pi name="xml">version="1.0"</xsl:pi>
> 
> 	<xsl:if test="advertisement">
> 		<xsl:text>&lt;adex&gt;</xsl:text>
> 			<xsl:if test="advertisement/advertiser">
> 				&lt;ad-info&gt;
> 				<xsl:value-of 
> select="advertisement/advertiser/name">
> 				&lt;/ad-info&gt;
> 			</xsl:if>
> 		<xsl:text>&lt;/adex&gt;</xsl:text>
> 	</xsl:if>
> </xsl:template>
> </xsl:stylesheet>
> 
> instead of using &lt; and &gt; is there any way i could print 
> "<" and ">" in
> the transformed xml code?
>
 
try this:

<xsl:template match="Advertisement">
<adex><xsl:apply-templates/></adex>
</xsl:template>
<xsl:template match="advertiser">
<ad-info><xsl:apply-templates/></ad-info>
</xsl:template>
<xsl:template match="name">
<name><xsl:apply-templates/></name>
</xsl:template>

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread