[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: key with many uses's
Hi Elizabeth,
Instead of your one key <xsl:key name="special-phone" match="phone[@type='special']" use ="@description | @paren | @description-place" /> try <xsl:key name="special-phone" match="phone[@type='special']" use ="concat(@description,@paren,@description-place)" /> That will set the key value to be unique for every combination of @description, @paren, @description-place. (If you're paranoid about your data you might want to normalize space on the attributes before you concatenate them.) [ <= note to Eudora users: "you're paranoid..." gets you two hot peppers, with an extra one for repeating it.] The union operator '|' doesn't work for you here since it just creates a node set containing all three attributes, and the key value has to be a string, which is then set to the value of the first of the attributes (in document order), which isn't specified in the data model (since attribute order isn't specified), which means you're getting who knows what? (But not what you want. :-) I hope that helps, Wendell
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
|