XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Adam Van den HovenSubject: Selecting the last instances in a nodeset
Author: Adam Van den Hoven
Date: 21 Jan 2002 10:04 PM
Hey,

I know I've done this before but I'm drawing a blank.

In my template I create a variable (using select) that is a nodeset of property nodes from various locations in my document (but not all the property nodes in the doc). My property nodes all have a name attribute. As it turns out, I have multiple properties with the same name. I want a nodeset that is made up of one property of each name and that property is the last one of that name.

I tried using keys (a variation on the Muenchian Method for groupig) but I'm running into walls. Does anyone have any ideas?

My nodeset:
val1
val2
val3
val4
val5

I want a nodeset that is:
val2
val4
val5
(order is not important)

Any ideas?

Adam

Postnext
Ivan PedruzziSubject: RE: Selecting the last instances in a nodeset
Author: Ivan Pedruzzi
Date: 21 Jan 2002 11:23 PM

Hi Adam,

this should work


xmlns:xsl="http://www.w3.org/1999/XSL/Transform">




val1
val2
val3
val4
val5




test="not(following-sibling::*[@name=current()/@name])">









Ivan Pedruzzi
eXcelon Corporation
http://www.stylusstudio.com



> -----Original Message-----
> From: stylus-studio-xslt Listmanager [mailto:listmanager]
> Sent: Monday, January 21, 2002 10:14 PM
> To: Recipients of 'stylus-studio-xslt' suppressed
> Subject: Selecting the last instances in a nodeset
>
>
> From: "Adam Van den Hoven"
>
> Hey,
>
> I know I've done this before but I'm drawing a blank.
>
> In my template I create a variable (using select) that is a
> nodeset of property nodes from various locations in my
> document (but not all the property nodes in the doc). My
> property nodes all have a name attribute. As it turns out, I
> have multiple properties with the same name. I want a nodeset
> that is made up of one property of each name and that
> property is the last one of that name.
>
> I tried using keys (a variation on the Muenchian Method for
> groupig) but I'm running into walls. Does anyone have any ideas?
>
> My nodeset:
> val1
> val2
> val3
> val4
> val5
>
> I want a nodeset that is:
> val2
> val4
> val5
> (order is not important)
>
> Any ideas?
>
> Adam
>
>
>
> To reply: mailto:stylus-studio-xslt.4466@edn.exceloncorp.com
> To start a new topic: mailto:stylus-studio-xslt@edn.exceloncorp.com
> To login: http://edn.exceloncorp.com/~SSDN
>
>

Postnext
Adam Van den HovenSubject: RE: Selecting the last instances in a nodeset
Author: Adam Van den Hoven
Date: 22 Jan 2002 01:13 PM
Ivan,

Unfortunately its not going to work in my situation. My nodeset is created by with a select

select="//theme[@id=current()/@themeid]/property | property[@name]"

and so the following siblings axis is meaningless in this case since it refers to document not the nodeset.

I ended up using the Muenchian method (with some modifications) but now I seem to be having other problems with it.

Any more ideas would be useful.
Adam

Posttop
Ivan PedruzziSubject: RE: Selecting the last instances in a nodeset
Author: Ivan Pedruzzi
Date: 22 Jan 2002 11:00 PM

Hi Adam

The following approach works with node-set too.


xmlns:xsl="http://www.w3.org/1999/XSL/Transform">




val1
val2
val3
val4
val7

val1
val8
val10


















Ivan Pedruzzi
eXcelon Corporation
http://www.stylusstudio.com



> -----Original Message-----
> From: stylus-studio-xslt Listmanager [mailto:listmanager]
> Sent: Tuesday, January 22, 2002 1:24 PM
> To: Recipients of 'stylus-studio-xslt' suppressed
> Subject: RE: Selecting the last instances in a nodeset
>
>
> From: "Adam Van den Hoven"
>
> Ivan,
>
> Unfortunately its not going to work in my situation. My
> nodeset is created by with a select
>
> select="//theme[@id=current()/@themeid]/property | property[@name]"
>
> and so the following siblings axis is meaningless in this
> case since it refers to document not the nodeset.
>
> I ended up using the Muenchian method (with some
> modifications) but now I seem to be having other problems with it.
>
> Any more ideas would be useful.
> Adam
>
>
>
> To reply: mailto:stylus-studio-xslt.4480@edn.exceloncorp.com
> To start a new topic: mailto:stylus-studio-xslt@edn.exceloncorp.com
> To login: http://edn.exceloncorp.com/~SSDN
>
>

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.