[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

multi-valued non-unique keys with use parameter using

Subject: multi-valued non-unique keys with use parameter using tokens?
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Tue, 23 Sep 2003 14:51:27 -0700 (PDT)
non unique keys
Hi,

  How to build multi-valued non-unique keys with key
built with tokens?
  
  My input XML looks like:
  <row row="15">
      <cell column="1">supplier</cell>
      <cell column="2">s1</cell>
      <cell column="3">item</cell>
      <cell column="4">item1|item2</cell>
      <cell column="5">s1_AM1</cell>
      <cell column="6">accepted</cell>
  </row>
  <row row="16">
      <cell column="1">supplier</cell>
      <cell column="2">s2</cell>
      <cell column="3">item</cell>
      <cell column="4">item1|item3|item4</cell>
      <cell column="5">s2_AM1</cell>
      <cell column="6">accepted</cell>
  </row>
  
  I want to group these based on items, so that when I
process each of the items later, I can retrieve the
appropriate rows to process at that time.
  For example, key("itemInvites", "item1") should
return both above rows and key("itemInvites", "item3")
should only return row 16.
  I know that if I can change the input XML, replace
pipe delimited values with sub-elements:
  	<cell column="4">
  		<subcell>item1</subcell>
  		<subcell>item2</subcell>
  	</cell>
  I can use the following xsk:key to build what I
need:  
  <xsl:key name="itemInvites"
match="//row[cell[@column=3] = 'item']"
use="cell/subcell"/>
  But is there a way to build the "use" parameter to
use tokens returned by str:tokenize template such as
below?
<xsl:variable name="InvitedSuppliers">
  <xsl:call-template name="str:tokenize">
    <xsl:with-param name="string" select="."/>
    <xsl:with-param name="delimiters" select="'|'"/>
  </xsl:call-template>
</xsl:variable>
  
thanks,
Xiaocun Xu

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.