XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
[xml-dev] Re: How to get XPath in a XSLT shylesheet

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS