xslt - Join two string sequences in xpath -
how can create union of 2 string sequences in xpath 2.0?
having 2 functions...
<xsl:function name="my:foo" as="xs:string*"> .... </xsl:function> <xsl:function name="my:bar" as="xs:string*"> .... </xsl:function>
i want iterate on both resulting string sequences like:
<xsl:variable name="myresult" select="for $s in my:foo() ??union?? my:bar() return my:dosomethingwith($s)" />
just found answer in book "xslt 2.0 , xpath 2.0 4th edition", chapter 10 "the comma operator":
the operands of «,» operator can 2 sequences. of course, single item sequence, operands can single items. either of sequences can empty, in case result of expression value of other operand.
so like:
<xsl:variable name="myresult" select="for $s in (my:foo(), my:bar()) return my:dosomethingwith($s)" />
Comments
Post a Comment