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

Repeated Recursion on different parts of a tree

Subject: Repeated Recursion on different parts of a tree
From: Peter Doggett <ee99ppd@xxxxxxxxxxxx>
Date: Wed, 25 Sep 2002 16:00:19 -0400 (EDT)
different recursion
I am quite familiar with recursive processing in
XSL, and its use as a 'replacement' to variables that cant be 
redifined. However I have come across a problem
I cant seem to solve and was wondering if anyone could help me?

Basically I have the following XML code:

<register name="DATA" offset="0">
    <no_of_regs>1</no_of_regs>
    <descriptivename>Data register</descriptivename>
    <description>The ...ster.</description>
    <description>In ord..H.</description>
    <description>..Oe...</description>
    <bitfield name="DATA">
      <function>Input data.</function>
      <bitpos>0</bitpos>
      <no_of_bits>10</no_of_bits>
      <initialvalue>0</initialvalue>
      <accesstype>RW</accesstype>
    </bitfield>
    <bitfield name="Reserved">
      <function>Output data</function>
      <bitpos>10</bitpos>
      <no_of_bits>6</no_of_bits>
      <initialvalue>0</initialvalue>
      <accesstype>RW</accesstype>
    </bitfield>
etc..........

</register>

<register name="SWAP" offset="10">
    <no_of_regs..........



 It is used for a hardware project I am working on at university. I want to
do do some arithmetic and bitwise operations
on each bitfield <initialValue> element, and its <bitpos> element. 
(What I hope to achieve is -
using all of the bitfields correctly together to describe the whole
register in my output document)


Now I know recursively I can 'update a variable' with the bitfield
information I need. However, when traversing my XML, how can I keep a
record of what values I have processed
in the tree. For example If I have recursively called a template to
process <bitfield name="DATA">, when the template is recalled recursively,
how do I get it to now work on <bitfield name="Reserved">, and then the 
node after that etc ?

How would I keep track of the elements I have processed? 

Thankyou very much for your time

----------------------
Peter Doggett
ee99ppd@xxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.