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

xsl problem

Subject: xsl problem
From: "poppe chris" <pc_poppe@xxxxxxxxxxx>
Date: Tue, 30 Mar 2004 16:35:16 +0200
msn poppe
Hello, Im facing the following problem,

I have a xml file like this, in wich an A element contains an offset (20, 30, 40) and a length (5, 10, 5) and the size element in the header is the sum of the lengths.

  <header>
          <size>20</size>
  </header>
  <GOP>
    <content>
        <A>20 5</A>
        <B/>
        <A>30 10</A>
        <A>40 5</A>
        <B/>
     </content>
  </GOP>

What i want to do is match any A element and alter the length for example everywhere + 3 except for lenghts greater then or equal to 10. But the problem is that I then have to change the size.
So the outputxml file should be:


  <header>
          <size>26</size>
  </header>
  <GOP>
    <content>
        <A>20 8</A>
        <B/>
        <A>30 10</A>
        <A>40 8</A>
        <B/>
     </content>
  </GOP>

I dont have a problem changing the A elements but i do have a problem in changing the size to the right number. Currently im using 2 xsl files to solve this, one to change the A elements and put the changed length in an helper element, this produces the following xml file

  <header>
          <size>20</size>
  </header>
  <GOP>
    <content>
        <A>20 8</A>
        <help>8</help>
        <B/>
        <A>30 10</A>
        <help>10</help>
        <A>40 8</A>
         <help>8</help>
        <B/>
     </content>
  </GOP>

And then i use another xsl transformation to change the size.

I would love to see all this happen in one xsl transformation,

anyone got any idea's?
greetings,
Chris

_________________________________________________________________
Ben jij klaar voor De Vuilbek? http://devuilbek.msn.be/start.php Nu op JIM en MSN


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.