[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] XPath to get value of xmlns attribute
Subject: RE: [xsl] XPath to get value of xmlns attribute From: "Michael Kay" <mhk@xxxxxxxxx> Date: Tue, 9 Mar 2004 14:30:28 -0000 |
xmlns "attributes" are represented as namespace nodes in the data model, not as attribute nodes. You can find them using the namespace axis (namespace::*). Note that this finds all the namespaces in scope, including those declared on ancestor elements. Michael Kay # -----Original Message----- # From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl- # list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Munna D # Sent: 09 March 2004 13:20 # To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx # Subject: [xsl] XPath to get value of xmlns attribute # # Hi, # Say I have an xml document beginning as follows: # <!--extract for example--> # <?xml version="1.0" encoding="utf-8"?> # <feed version="0.2" xmlns="http://purl.org/atom/ns#" # xmlns:tt="http://www.tt.org/ns#"> # <!--end of extract--> # # I want to make a list of all atttributes (including namespace declaration # ones). However, both of the templates below fail to pick up the xmlns and # xmlns:tt attributes: # <xsl:template match='@*'> # <xsl:value-of select="name()"/> # ='<xsl:value-of select="."/>' # </xsl:template> # # and # # <xsl:template match="@*[starts-with(name(.),'xmlns')]" > # # <xsl:value-of select="name()"/> # ='<xsl:value-of select="."/>' # </xsl:template> # # Can someone please tell me how I can get these values? # # Thanks, # Munna # # # -- # _______________________________________________ # Get your free email from http://www.iname.com # # # XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath to get value of xml, G. Ken Holman | Thread | Re: [xsl] XPath to get value of xml, Munna D |
Re: [xsl] xsl search engine, David Carlisle | Date | [xsl] positional grouping xslt2, David . Pawson |
Month |