Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for xml2xpath.xsl

(view source code of xml2xpath.xsl as plain text)

  1. <?xml version="1.0" encoding="windows-1252" ?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.   <xsl:output method="text"/>
  4.     <xsl:strip-space elements = "*" />
  5.     <xsl:template match="text()">
  6.  
  7.     <xsl:for-each select="ancestor-or-self::*">
  8.       <xsl:text>/</xsl:text>
  9.       <xsl:value-of select="name()" />
  10.     </xsl:for-each>
  11.  
  12.     <xsl:text>():</xsl:text>
  13.     <xsl:value-of select="." />
  14.     <xsl:text>&#xA;</xsl:text>
  15.     <xsl:apply-templates/>
  16.   </xsl:template>
  17. </xsl:stylesheet>

page last modified: 2024-04-16; loaded in 0.0064 seconds