[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] key definition
Given the following XML:
<items> <item> <data id="1">alpha</data> <data id="2">gamma</data> </item> <item> <data id="1">alpha</data> <data id="2">delta</data> </item> <item> <data id="1">beta</data> <data id="2">gamma</data> </item> </items> I am searching for a key definition that will return the set of <item>'s that have a given @id and <data> value. I want to use key() in the following manner: given variables $id and $value select="key('MyKey',concat($id,$value))" examples select="key('MyKey',concat('1','alpha')) returns the first and second <item>'s select="key('MyKey',concat('2','gamma')) returns the first and third <item>'s Anyone know how to complete this definition (or suggest another)? <xsl:key name="MyKey" match="/items/item" use="?" /> Second question: What happens if I encounter markup that looks like this: <item> <data id="1">01</data> <data id="10">1</data> </item> in which case the usage of concat($id,$value) aliases into "101" _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp 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
|