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

RE: Nodesets handling (getting subsets)

Subject: RE: Nodesets handling (getting subsets)
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Sun, 23 May 2004 08:39:08 -0600
resulttreefragment xsl
Hi Marco,

If I am understanding you correctly then you should be able to use the
total count of the elements that match
'office:document-content/office:body/draw:page' of your source document
as your base and then exclude any 'slide' elements whose number
attribute is greater than this value.  The most efficient way of doing
this is to first create a variable that contains the count from your
source document:

<xsl:variable name="pageCount"
select="count(document('#content.xml')/office:document-content/office:bo
dy/draw:page)"/>

And then compare that number with the number attribute of each slide
element from your original variable to get the resulting result tree
fragment.

<xsl:variable name="resultTreeFragment"
select="$selected-slides[not(@number > $pageCount)]"/>

Let me know if I understand your dilemma accurately and if the above was
helpful.

Best regards,

<M:D/>

> -----Original Message-----
> From: Marco [mailto:brbromo@xxxxxx]
> Sent: Thursday, May 20, 2004 7:35 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Nodesets handling (getting subsets)
> 
> I have a nodeset parameter called $selected-slides. It is a set of
> 'slide' elements with a 'number' attribute.
> 
> I would like to remove from that nodeset those elements whose 'number'
> attribute is not associated with any draw:page element in the xml
> source. In other words, those 'slide' elements whose 'number'
attribute
> is not the position number of any draw:page element in the source xml.
> 
> But if I create a new variable with the select expression:
> 
> $selected-slides[count(document('#content.xml')/office:document-
> content/office:body/draw:page[position()
> 
> = number(@number)]) &gt; 0]
> 
> I get no $selected-slides elements because (IMHO) @number does not
refer
>   to the 'slide' element inside $selected-slides.
> How could I solve this problem?
> 
> Thanks in advance,
> Marco

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.