943,689 Members | Top Members by Rank

Ad:
Jan 16th, 2009
0

Template is not invoked.

Expand Post »
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>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
learningxslt is offline Offline
3 posts
since Jan 2009
Jan 16th, 2009
0

Re: Template is not invoked.

Can you please supply a sample XML file also.
Reputation Points: 22
Solved Threads: 11
Junior Poster
fpmurphy is offline Offline
144 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in XML, XSLT and XPATH Forum Timeline: Adding New Element using XSLT
Next Thread in XML, XSLT and XPATH Forum Timeline: Amount To Currency[Urgent]





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC