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

passing_cousin_content_as_counter

Subject: passing_cousin_content_as_counter
From: mankar@xxxxxxxxxxxxxxx
Date: Sat, 31 Jul 2004 21:01:46 +0300
 passing_cousin_content_as_counter
Hallo again,

and first of all, forgive me for having previously posted my question in
such a confusing way!

I was wondering if someone could, by the use of one stylesheet, select the
values of the first,
the fourth and the seventh <ELEM_INFO_ITEM> children of <ELEM_INFO>
element. Note that the number
of <ELEM_INFO_ITEM> nodes is not predefined.In this example there are
exactly nine nodes, but
in other cases there might be only three or twelve etch, but always number
that is multiple of
three.

I then would like to use the extracted values as counter values, to apply
counting on
the COORDINATE_ITEM node-set and select specific COORDINATE_ITEM
elements.In this example, based
on the extracted values (1, 7 and 11 ), i would like to select the first,
seventh and eleventh
COORDINATE_ITEM elements content.

The source xml is the one following:


<SHAPE>
- <ELEM_INFO>
     <ELEM_INFO_ITEM>1</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>1001</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>5000</ELEM_INFO_ITEM>

     <ELEM_INFO_ITEM>7</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>1002</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>5000</ELEM_INFO_ITEM>

     <ELEM_INFO_ITEM>11</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>1003</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>5000</ELEM_INFO_ITEM>
  </ELEM_INFO>
- <COORDINATES>
    <COORDINATES_ITEM>68</COORDINATES_ITEM>  !first
    <COORDINATES_ITEM>54</COORDINATES_ITEM>
    <COORDINATES_ITEM>72/COORDINATES_ITEM>
    <COORDINATES_ITEM>65</COORDINATES_ITEM>
    <COORDINATES_ITEM>83</COORDINATES_ITEM>
    <COORDINATES_ITEM>17</COORDINATES_ITEM>
    <COORDINATES_ITEM>20</COORDINATES_ITEM>  !seventh
    <COORDINATES_ITEM>60</COORDINATES_ITEM>
    <COORDINATES_ITEM>24</COORDINATES_ITEM>
    <COORDINATES_ITEM>55</COORDINATES_ITEM>
    <COORDINATES_ITEM>98</COORDINATES_ITEM>  !eleventh
    <COORDINATES_ITEM>25</COORDINATES_ITEM>
  <COORDINATES>
</SHAPE>


Can this be achieved with the use of one and only stylesheet??The output i
want to generate
should be identical with the source, except for that the selected
COORDINATE_ITEM elements
will also contain a character like d for example, concatenated with their
number value.That
last thing is very easy with the use of concat, but what about the previous
issues.They look
quite heavy programmaticaly for xslt. Should i use variables??


output xml


<SHAPE>
- <ELEM_INFO>
     <ELEM_INFO_ITEM>1</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>1001</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>5000</ELEM_INFO_ITEM>

     <ELEM_INFO_ITEM>7</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>1002</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>5000</ELEM_INFO_ITEM>

     <ELEM_INFO_ITEM>11</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>1003</ELEM_INFO_ITEM>
     <ELEM_INFO_ITEM>5000</ELEM_INFO_ITEM>
  </ELEM_INFO>
- <COORDINATES>
    <COORDINATES_ITEM>d68</COORDINATES_ITEM> !first
    <COORDINATES_ITEM>54</COORDINATES_ITEM>
    <COORDINATES_ITEM>72/COORDINATES_ITEM>
    <COORDINATES_ITEM>65</COORDINATES_ITEM>
    <COORDINATES_ITEM>83</COORDINATES_ITEM>
    <COORDINATES_ITEM>17</COORDINATES_ITEM>
    <COORDINATES_ITEM>d20</COORDINATES_ITEM>  !seventh
    <COORDINATES_ITEM>60</COORDINATES_ITEM>
    <COORDINATES_ITEM>24</COORDINATES_ITEM>
    <COORDINATES_ITEM>55</COORDINATES_ITEM>
    <COORDINATES_ITEM>d98</COORDINATES_ITEM> !eleventh
    <COORDINATES_ITEM>25</COORDINATES_ITEM>
  <COORDINATES>
</SHAPE>


Regards
Manousos
Athens

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.