Subject: RE: The order of selected nodes in a select pattern with OrExpres sions? From: David Schach <davidsch@xxxxxxxxxxxxx> Date: Sun, 24 Jan 1999 14:06:07 -0800 |
In XQL, upon which the Microsoft implementation of XSL patterns is based, document order is preserved by unions. > -----Original Message----- > From: Tyler Baker [SMTP:tyler@xxxxxxxxxxx] > Sent: Sunday, January 24, 1999 12:52 PM > To: xsl-list@xxxxxxxxxxxxxxxx > Subject: The order of selected nodes in a select pattern with > OrExpressions? > > One thing that does not seem to be clear in the XSL in the XSL draft is > in what order the nodes should be selected in a select expression with > or expressions present. > > For example say I have an XML file: > > <a> > <b1> > a > </b1> > <b2> > b > </b2> > <b3> > c > </b3> > </a> > > What if I have a template: > > <xsl:template match=a> > <xsl:apply-templates select="b3 | b2 | b1"> > </xsl:template> > > Should the output text be: cba, or should the output text be: abc. > > A more general question is: "Is the order of the UnionExpressions more > significant or is the document order of the elements more significant"? > > Basically what I am getting at is should an XSL Processor evaluate each > PathExpression in the UnionExpression separately and in the order that > the UnionExpressions are in, or should an XSL Processor recursively > evaluate each subtree expression of each path expression in the union > expression in that order. > > Right now I am under the assumption that an XSL Processor should do > something like: > > for each path expression in a union expression > select all nodes which match up with the last subtree expression of > the currently tested path expression > > Then filter out any repeatedly selected nodes in the list. > > The spec only says that: > > "The context of the right hand side expressions is the context of the > left hand side expression. The results of the right hand side > expressions are node sets. The result of the left hand side UnionExpr is > the union of the results of the right hand side expressions." > > My understanding here is that you select in the order in which the path > expressions occur and filter out redundantly selected nodes. > > Is this the right way to do things or am I barking up the wrong tree > here? > > Tyler > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: The order of selected nodes in , G. Ken Holman | Thread | mixed-content values, Borden, Jonathan |
The order of selected nodes in a se, Tyler Baker | Date | mixed-content values, Borden, Jonathan |
Month |