DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   XML, XSLT and XPATH (http://www.daniweb.com/forums/forum134.html)
-   -   Template is not invoked. (http://www.daniweb.com/forums/thread168730.html)

learningxslt Jan 16th, 2009 7:49 am
Template is not invoked.
 
Hi All,
I have a stylesheet with a identity transformation template and an element specific template. However, when I ran the below stlyesheet over a xml file, only identity transformation is invoked. My element specific template isn't.

There is a target namespace for the schema that defines the elements. I have specified in the stylesheet using xmlns attribute as below.

Can you please help.

Regards

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

<xsl:output method="xml" encoding="utf-8"/>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="XYZ">
....
....
</xsl:template>

</xsl:stylesheet>

fpmurphy Jan 16th, 2009 7:53 pm
Re: Template is not invoked.
 
Can you please supply a sample XML file also.


All times are GMT -4. The time now is 2:41 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC