Subject: XPath Expression in XSL Template Will Not Return Document Element with Attributes
From: Joshua Glenn <joshglenn1@xxxxxxx>
Date: Mon, 9 Feb 2009 16:03:57 -0600
|
Listmembers, I have a problem creating an appropriate XPath expression in a XSL file, and have been unable to find a solution. Here the Scenario: I have an xml file output from asp.net xmlserializer class. It outputs the Document Element "Catalog" with three attributes pertaining to XML namespaces.
the catalog tag looks like this (markup removed):
Catalog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
I have created an XSL file to restructure the information for use in a ASP.NET GridView Control.
xsl:template match="/"
xsl:apply-templates select="Catalog"
xsl:template>
It works, but only if I remove the attributes from the Element. I need to know how to format the xsl:template match="Catalog" xpath expression in the XSL file to match that tag, even if it has attributes.
This is my first post to this list. I hope this is a resource that will be helpful, and as I become more proficient in XPath and XSL, I'll be able to help others.
Thanks in advance.
|