|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: returning single result from apply-templates
David Carlisle > foo//bar[1] > All the bar which are the first child of any descendent of any foo > child of the current node. > > foo/descendant::bar[1] > All the bar which are the first descendant of any foo child of the > current node. > > foo//bar > All the bar which are descendants of any foo child of the current > node. > > (foo//bar)[1] > The first node in document order in the node set constructed above. > Note if there is more than one foo child this is the only one > guaranteed to select at most one node Picks out a nodeset matching foo//bar, picks out the first of this nodeset? So the ()[integer] construct guarantees a single node? Whereas foo//bar[1], given a number of matches, will return n nodes. > Just what do the () do here? > > Make the [] apply to the whole node set constructed by foo//bar rather > than just the last step in //bar[1]. Reasonable (if not DC accurate) view then would be (1) foo//bar[1] applies the whole path as many times as are found in the src document whereas (2) (foo//bar)[1] creates the nodeset in () first, then applies the predicate? Thanks David. Very clear. Regards DaveP 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
|

Cart








