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

Re: xsl:key match all values

Subject: Re: xsl:key match all values
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Mon, 28 Mar 2005 13:27:09 -0700
xpath match all
The idea behind the key creation was to create a "shortcut" to some
fairly complex locations of data within my xml source.  Yes,
understood that straight xpath queries will do the trick but
ultimately interested in wrapping up the xpath query in a key!

Wendel:  can you explain how your solution works?  Actually nevermind,
I get it : )
I wish there was a way to do this without being forced to provide the
"1" in the 2nd argument of the xsl:key statement.  Errr.... but that's
ok.

Karl


On Mon, 28 Mar 2005 11:14:23 -0800 (PST), Mukul Gandhi
<mukul_gandhi@xxxxxxxxx> wrote:
> Hi Karl,
>  I think this can be done without keys, using XPath
> only..
> 
> <xsl:copy-of select="//BBB[@t='1']/child::*" />
> (if there is only one node BBB t='1')
> 
> , or
> 
> <xsl:copy-of select="(//BBB[@t='1'])[1]/child::*" />
> (if there are multiple BBB t='1' nodes; this selects
> the 1st match)
> 
> // may not be necessary if you want to operate at a
> particular context node.
> 
> (this is not tested)
> 
> Regards,
> Mukul
> 
> --- Karl Stubsjoen <kstubs@xxxxxxxxx> 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
> >
> >
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/

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.