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

RE: Problem for : increment a variable in a for-each?

Subject: RE: Problem for : increment a variable in a for-each?
From: que Li <queincanada@xxxxxxxx>
Date: Mon, 29 Nov 2004 10:46:10 -0500 (EST)
increment xml variable
Hi Mike:
   I try to use some example to explain my question.I
really need fix it.

Example:
My xml file is:
<List>
   <List_ID>10</List_ID>
   <Title>A</Title>
   <ParentID>1</parentID>
</List>
<List>
   <List_ID>11</List_ID>
   <Title>B</Title>
   <ParentID>1</parentID>
</List>
<List>
   <List_ID>12</List_ID>
   <Title>C</Title>
   <ParentID>10</parentID>
</List>
<List>
   <List_ID>13</List_ID>
   <Title>D</Title>
   <ParentID>10</parentID>
</List>
<List>
   <List_ID>14</List_ID>
   <Title>E</Title>
   <ParentID>15</parentID>
</List>

what I need do :
1. Find all <list> node which parentID=1 (Example
List_ID ia 10 and 11) 
I can use pattern as : select="List[parentID=1]"

2.and find all the 
<list> node which parentID not equal 1 but also no
List_ID on the xml equal to the current parentID
(Example: List_ID is 14. so Its parentID is 15. when
we search all List node where List_ID =15 .no macth 
so List_ID=14 is node which I need count)

For List_ID is 12 and 13, their parentID is 10. when I
search List node which ID is equal current node
parentID (now it is 10) and it exist so List_ID is 12
and 13 is not what I want.


so in the xml file ,three node satisfy my filter
condition:They are 
<List>
   <List_ID>10</List_ID>
   <Title>A</Title>
   <ParentID>1</parentID>
</List>
<List>
   <List_ID>11</List_ID>
   <Title>B</Title>
   <ParentID>1</parentID>
</List> 
<List>
   <List_ID>14</List_ID>
   <Title>E</Title>
   <ParentID>15</parentID>
</List>

then I need do different things based on the node
position in the satisfiled node( not all the node
list) 
It is my problem. no matter what I use, I can't find
the position inside node which I filter from original
source since position() will tell you the position on
the source.


I wish you can understand my question now.

Thanks
Helena

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

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.