[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A theory problem
Kay Michael wrote: > > > > > [James Clark] > > >> A path expression has the property if > > >> > > >> (a) it doesn't use / and the axis is a forward axis, or > > >> > > >> (b) it is a / expression, and the left hand operand has the > > >> "single-level" property and the right hand operand has the > > >> "stays-in-subtree" property. > > > > [Michael Kay] > > >This is nice and clean, but it doesn't seem to catch > > >child::A/child::B/child::C. > > > > Do you mean as a select or as a match pattern? As a select, > > child::A is > > single-level and child::B has stays-in-subtree; taken together, > > child::A/child::B is single-level and child::C has stays-in-subtree. > > > We're talking about expressions not patterns, since document order is > irrelevant in patterns. > > James' definition of "single-level" was that a set of nodes was single level > if they all had the same parent; therefore child::A/child::B is not single > level. This is why I was trying to use a more general concept of "peer" > nodes. You're right: having the same parent isn't quite the right concept and it's not quite what I implement in XT. The definition should be such that if E1 and E2 are single-level then E1/E2 is. I think the right concept is that there's a constant difference in the levels of the context node and the result nodes. More precisely, define the level of a node to be the number of ancestors it has, and then define an expression to be single-level if and only if there exists an integer n such that for any node x, for any node y in the result of evaluating the expression with respect to x, the difference between the level of x and the level of y is equal to n. In XT I implement / as right associative; this makes the left hand operands of / in child::A/child::B/child::C all be single-level even in the narrower sense of the original definition I proposed. James XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|