OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
XPath on sequences of nodes


I am observing a strange phenomenon in an xslt-based project, using  
the Saxon 8 processor. It pertains to a sequence of nodes created  
within a perform-sort instruction. In the simple xslt sheet following  
this message, I create a sequence of nodes, store it in a variable,  
and I print its content through 2 very similar instructions, but I  
get one node sequence for the first instruction, and another  
(inverted) one for the second instruction.

For the life of me, I don't know what's happening. How can a variable  
store 2 different results? I'd really appreciate it if someone could  
give me a hint.

Thank you very much.

Fabrizio Gotti
RALI - http://rali.iro.umontreal.ca/


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";  
     <xsl:output method="xml" indent="yes" encoding="UTF-8" />

     <xsl:template match="/">

         <xsl:variable name="selectedSents" as="node()*">
                 <xsl:sort order="descending"/>

             <!-- Here, the very same variable selectedSents will  
yield 2 different representations -->
                 <xsl:copy-of select="$selectedSents/c"/> <!-- one  
sequence -->
                 <xsl:copy-of select="$selectedSents" /><!-- another  
sequence, inverted -->



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS