|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Fetch a sequence of nodes from input file
At 2009-09-23 18:34 -0400, rowan@xxxxxxxxxxxxxxxxxxxxx wrote:
Thanks very much for these ideas. I'm trying to use Martin's solution but I don't understand the line: <xsl:copy-of select="$si | $si/following-sibling::item[. << $si/following-sibling::item[level <= $si/level][1]]"/> $a << $b is true when the singleton node in the variable "a" is before the singleton node "b" in document order in the same tree. $a >> $b is true when $a is after $b in document order in the same tree. $a is $b is true when $a is the same node as $b. Now I said "in the same tree", but it works it just is implementation dependent when comparing nodes from one tree to another tree. One processor will have it one way and another processor will have it in another order. So you will get true/false when comparing document order between nodes from different trees, but not necessarily the same answer when using two different processors on the same tree. I hope this helps. . . . . . . . . . Ken T:\ftemp>type rowan2.xsl
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0"><xsl:output method="text"/> <xsl:template match="/">
<xsl:variable name="tree1" as="element(doc)">
<doc>
<a/>
<b/>
</doc>
</xsl:variable>
<xsl:variable name="tree2" as="element(doc)">
<doc>
<a/>
<b/>
</doc>
</xsl:variable>1/a << 1/b: <xsl:value-of select="$tree1/a << $tree1/b"/> 1/a >> 1/b: <xsl:value-of select="$tree1/a >> $tree1/b"/> 1/a is 1/a: <xsl:value-of select="$tree1/a is $tree1/a"/> 1/a is 1/b: <xsl:value-of select="$tree1/a is $tree1/b"/> 1/a << 2/b: <xsl:value-of select="$tree1/a << $tree2/b"/> 1/a >> 2/b: <xsl:value-of select="$tree1/a >> $tree2/b"/> </xsl:template> </xsl:stylesheet> T:\ftemp>xslt2 rowan2.xsl rowan2.xsl
-- Upcoming hands-on code list, UBL, XSLT, XQuery and XSL-FO classes. Interested in other classes? http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
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
|

Cart








