[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
[xml-dev] Re: How to get XPath in a XSLT shylesheet
- From: "Stephen Green" <stephen_green@bristol-city.gov.uk>
- To: <xml-dev@lists.xml.org>
- Date: Tue, 09 Jan 2007 15:10:37 +0000
I use something like:
for an attribute
<xsl:for-each select="ancestor-or-self::*">
<xsl:if test="local-name()=name()">/default:</xsl:if>
<xsl:if test="not(local-name()=name())">/</xsl:if>
<xsl:value-of select="name()"/>[<xsl:number/>]</xsl:for-each>/@<xsl:value-of select="name()"/></xsl:variable>
and for an element
<xsl:for-each select="ancestor-or-self::*">
<xsl:if test="local-name()=name()">/default:</xsl:if>
<xsl:if test="not(local-name()=name())">/</xsl:if>
<xsl:value-of select="name()"/>[<xsl:number/>]</xsl:for-each>
All the best
Stephen Green
>>> "Dimitre Novatchev" <dnovatchev@yahoo.com> 09/01/07 14:26:49 >>>
This snippet is 5 years old:
http://www.topxml.com/code/default.asp?p=3&id=v20010323001030
Cheers,
Dimitre Novatchev
"Long JingJun" <longjingjun@yahoo.com.cn> wrote in message
20070108035722.19643.qmail@web15705.mail.cnb.yahoo.com">news:20070108035722.19643.qmail@web15705.mail.cnb.yahoo.com...
Hi there,
Is there a way to get the full XPath of current node as a String in an XSLT
stylesheet?
Thanks,
Long
__________________________________________________
Ï¿ì×¢²áÑÅ»¢³* óÈÝÁ¿Ãâ·ÑÓÊÏä?
http://cn.mail.yahoo.com
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]