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

Re: Need some help with an XPath

Subject: Re: Need some help with an XPath
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 21 Feb 2003 22:57:30 +0100
credit servid
Use:

/*/*/service[
                   not(@servId = /*/*[1]/*/@servId
                      and
                         @servId = /*/*[2]/*/@servId
                      and
                        @servId = /*/*[3]/*/@servId
                         )
                    ]



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL



"Adam van den Hoven" <list@xxxxxxxxxxxxxxxxxxx> wrote in message
news:2CFBE0D9CD992F41BE13069173C5C1C94B8445@xxxxxxxxxxxxxxxxxxx
> I have a node set that looks something like:
>
> <branch>
>     <service servId="Service 1" />
>     <service servId="Service 3" />
>     <service servId="Service 4" />
> </branch>
> <branch>
>     <service servId="Service 1" />
>     <service servId="Service 2" />
>     <service servId="Service 4" />
> </branch>
> <branch>
>     <service servId="Service 1" />
>     <service servId="Service 3" />
>     <service servId="Service 4" />
> </branch>
>
> Now what I want is a set of all the service elements that do not appear
> in ALL the branch Elements. In this case I'm hoping for
>
>     <service servId="Service 3" />
>     <service servId="Service 2" />
>     <service servId="Service 3" />
>
> Although the extra "Service 3" doesn't really need to be there, the way
> I'll be using it doesn't care.
>
> Now my first thought was:
>
> "All the services elements where the number of branch elements does not
> equal the number of branch elements containing this service element"
>
> the XPath for this (assuming $branch contains the nodeset in question) :
>
> service[count($branch) != count($branch[service = ???])]
>
> The problem is that I'm not sure what to replace the ??? with. Clearly a
> period isn't going to work. Neither is current().
>
> Now I could use a for-each but I know better than to start there. I have
> a suspicion that keys will fit in the solution but I'm not 100% sure
> where.
>
> Any ideas?
>
> H. Adam van den Hoven
> Web Developer
> Credit Union Central of BC
> p 604 7306380
> e avandenhoven@xxxxxxxxx
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>




 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.