Hi,
I am not used to do XSLT 2.0.
While the Pattern of a xsl:key has more options in 2.0 than in XLST 1.0
http://www.w3.org/TR/xpath20/#prod-xpath-KindTest
it seems not to allow to match a sequence.
Is it possible to "store" a sequence in a node?
I tried
<xsl:variable name="s">
<xsl:sequence select="for $v in 1 to 10 return $v"/>
</xsl:variable>
but then $s is considered as string "1 2 3 4 5 6 7 8 9 10" and not as
sequence.
In case you could store a sequence in a node (how?) you could have
a variable holding all sequences in nodes like this (in $seqs):
<xsl:variable name="seqs"><seq>(1,2,3)</seq><seq>(4,5,6)</seq><seq>
(7,8,9)</seq></xsl:variable>
And have your sequence as:
(generate-id($seqs/seq[1]), generate-id($seqs/seq[2]), generate-id
($seqs/seq[3]))
You can dereference the sequence items by
<xsl:key name="node-by-id" match="node()" use="generate-id()"/>
to get the "containing" node and ??? to access the real sequence then ...
These ideas are inspired by "XSLT pointers" posting [1] and might be just
impossible in XSLT 2.0.
[1]
http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/201009/msg00180.html
Mit besten Gruessen / Best wishes,
Hermann Stamm-Wilbrandt
Developer, XML Compiler, L3
Fixpack team lead
WebSphere DataPower SOA Appliances
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
From: "Costello, Roger L." <costello(_at_)mitre(_dot_)org>
To: "xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com"
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Date: 10/08/2010 09:23 PM
Subject: [xsl] How to implement a sequence of sequences?
Hi Folks,
My understanding is that in XSLT 2.0 there is no such thing as a sequence
of sequences. Thus, this sequence:
('red', (1, 2, 3), 'blue')
is flattened into one sequence consisting of 5 items:
('red', 1, 2, 3, 'blue')
However, I really need sequences of sequences.
What's the best way to implement sequences of sequences in XSLT 2.0?
Has anyone already implemented some XSLT functions that provide sequences
of sequences?
/Roger
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--