Re: [xsl] xsl:key match all values

Subject: Re: [xsl] xsl:key match all values
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 28 Mar 2005 14:02:26 -0500
Karl,

A key for this would be:

<xsl:key name="BBB-children-by-t" match="BBB/*" use="../@t"/>

or you could simply retrieve the BBB by its @t

<xsl:key name="BBB-by-t" match="BBB" use="@t"/>

and then traverse to children by saying key('BBB-by-t','1')/*.

I hope that helps,
Wendell

At 01:41 PM 3/28/2005, you wrote:
Hello,

How do you setup a key that simply matches all child elements from the
match?  Given:

<AAA>
     <BBB t="1">
          <CCC  s = "1"/>
          <CCC  s = "2"/>
          <CCC  s = "3"/>
          <CCC  s = "4"/>
          <CCC  s = "5"/>
          <CCC  s = "6"/>
     </BBB>
     <CCC>
          <BBB  r = "a"/>
          <BBB  r = "b"/>
          <BBB  r = "c"/>
     </CCC>
     <BBB/>
     <BBB/>
</AAA>


I just want to return all child elements of BBB t='1'. So results would be:

          <CCC  s = "1"/>
          <CCC  s = "2"/>
          <CCC  s = "3"/>
          <CCC  s = "4"/>
          <CCC  s = "5"/>
          <CCC  s = "6"/>


Karl


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread