[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Testing implicit XHTML hierarchy
well i agree there is redundancy (damn I should really do this stuff instead of messing around ) but <xsl:variable name="h" select="//xhtml:*[matches(local-name(),'^h[1-6]')]/number(substring(local-name(),2))"/> <xsl:for-each select="1 to count($h)-1"> <result select="$h[.+1][1]"> <xsl:value-of select="$h[.+1][1]"/> </result> <result select="$h[.][1]"> <xsl:value-of select="$h[.][1]"/> </result> <result select="$h[.+1][2]"> <xsl:value-of select="$h[.+1][2]"/> </result> <result select="$h[.][2]"><xsl:value-of select="$h[.][2]"/> </result> </xsl:for-each> </output> </xsl:template> produces <?xml version="1.0" encoding="UTF-8"?> <output> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> <result select="$h[.+1][1]">2</result> <result select="$h[.][1]">1</result> <result select="$h[.+1][2]">5</result> <result select="$h[.][2]">2</result> </output> which I'm not following how $h[.+1][2] will always be empty? Since there are two items in the sequence I mean. Sorry if I'm not very clear right now, but I am not thinking especially sharpish. Cheers, Bryan Rasmussen On 7/5/07, David Carlisle <davidc@xxxxxxxxx> wrote:
|
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
|