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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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
>
>

   
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.