[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Friday challenge: XSLT thats creates XPaths for m
On Fri, 13 Apr 2007 06:48:26 -0400, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote: <xsl:for-each select="//*">
best, -Rob <xsl:variable name="path" select="concat('/', string-join(for $x in ancestor-or-self::* return concat($x/local-name(), '[', count(.|$x/preceding-sibling::*[name() = current()/name()]), ']'), '/'))" as="xs:string"/> <xsl:for-each select="text()[normalize-space(.) != '']"> <check><xsl:value-of select="concat($path, '/text[', position(), '] = ''', .,'''')"/></check> </xsl:for-each> <xsl:for-each select="@*"> <check><xsl:value-of select="concat($path, '/@', name(), ' = ''', ., '''')"/></check> </xsl:for-each> </xsl:for-each> </xml> </checkXML> </xsl:template>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|