RE: [xsl] namespace-alias problem

Subject: RE: [xsl] namespace-alias problem
From: "Touchtel" <omprakashv@xxxxxxxxxxxxxxxxx>
Date: Sun, 23 Jan 2005 15:07:36 +0530
Hi Joris,
   I appreciate your help. I am able to get this to work.

Regards,
Omprakash.V


-----Original Message-----
From: Joris Gillis [mailto:roac@xxxxxxxxxx]
Sent: Sunday, January 23, 2005 2:33 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] namespace-alias problem


Tempore 06:15:16, die 01/23/2005 AD, hinc in  
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Touchtel  
<omprakashv@xxxxxxxxxxxxxxxxx>:

>     Iam using a stylesheet to generate another stylesheet and having some
> problems like the processor not recognising the aliased namespace (x:)  
> the
> 2nd time around. The following are my xml and  and input and output
> stylesheet snippets. The snippets are quite large but I am not sure how  
> to
> make these smaller than this.

Hi,

Do the following things to make it work:
* omit 'exclude-result-prefixes="x"'
* write <xsl:element name="xsl:template"/> (or <x:template/>) rather than  
<xsl:element name="x:template"/>

This is a working stylesheet:

<xsl:stylesheet version="1.0"  
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";  
xmlns:x="http://www.w3.org/1999/XSL/TransformAlias";>

<xsl:namespace-alias stylesheet-prefix="x" result-prefix="xsl"/>

<xsl:output method="xml" indent="yes" encoding="iso-8859-1"/>

<xsl:template match="school">
     <x:stylesheet version="1.0">
<x:strip-space elements="*"/>

<xsl:element name="xsl:template">
<xsl:attribute name="match">
<xsl:value-of select="person"/>
</xsl:attribute>

<BODY>
     This is the body text
<x:apply-templates>
  <x:with-param name="path" select="person"/>
</x:apply-templates>
   </BODY>

</xsl:element>

<xsl:apply-templates />

</x:stylesheet>

</xsl:template>

<xsl:template match="student">

<xsl:if test="not(@name='person')">

<xsl:element name="xsl:template">
<xsl:attribute name="match">
<xsl:value-of select="@name" />
</xsl:attribute>

<a href="#">This is a student <x:value-of select="@name"/></a>
</xsl:element>

</xsl:if>

</xsl:template>

</xsl:stylesheet>



regards,
-- 
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Deserta faciunt et innovationem appelant

Current Thread