XSLT recursion with signals

Discussion in 'XML' started by Leo Kirch, Oct 27, 2003.

  1. Leo Kirch

    Leo Kirch Guest

    Hello XSLT gurus,

    i've got a rather difficult problem. Some explanations first.
    theres a signal oriented xml-file - the graphical represantation looks
    like:


    | startsignal (signal00)
    \ /
    ---------------------------------------------------------
    | top | _________
    part01 | | / \__
    | down |____/ \_______________
    --------------------------------------------------------
    | top |______
    part02 | | \
    | down | \________________________
    --------------------------------------------------------
    | top | ______________________
    part03 | | _____/
    | down |________/
    --------------------------------------------------------


    all parts have got two states (top,down) with different values to
    change
    between the states:

    part01: 2 ticks up, 4 ticks down, starting position down
    part02: 5 ticks up, 2 ticks down, starting position top
    part03: 7 ticks up, 3 ticks down, starting position down

    lets assume the startsignal's name is "signal00"

    part01 requires signal00 and generates signal01
    part02 requires signal01 and generates signal02
    part03 requires signal02 and generates signal03
    part01 requires signal03 and generates signal04

    the xml representation could be

    <project starttime="0" startsignal="signal00">
    <element name="part01">
    <positions>
    <position name="top" duration="2" starting="false" />
    <position name="down" duration="4" starting="true" />
    </positions>
    <signals>
    <signal gen="signal01">
    <and req="signal00" />
    </signal>
    <signal gen="signal04">
    <and req="signal03" />
    </signal>
    </signals>
    </element>

    <element name="part02">
    <positions>
    <position name="top" duration="5" starting="true" />
    <position name="down" duration="2" starting="false" />
    </positions>
    <signals>
    <signal gen="signal02">
    <and req="signal01" />
    </signal>
    </signals>
    </element>

    <element name="part03">
    <positions>
    <position name="top" duration="7" starting="false" />
    <position name="down" duration="3" starting="true" />
    </positions>
    <signals>
    <signal gen="signal03">
    <and req="signal02" />
    </signal>
    </signals>
    </element>
    </project>

    still reading that veeery long post? :) thanks! now assume you want to
    transform that
    signal oriented xml-file into a timetick oriented one:

    part01: (0,0) (2,1) (11,1) (15,0)
    part02: (0,1) (2,1) (4,0)
    part03: (0,0) (4,0) (11,1)

    tricky, eh? i wan't post the corresponding java-code here (due to
    size) but will make
    it available on request at no time.

    thanks for playing with that problem

    yours
    sebastian
     
    Leo Kirch, Oct 27, 2003
    #1
    1. Advertising

  2. I would be glad to help, however, I cannot understand anything from your
    description.


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL


    "Leo Kirch" <> wrote in message
    news:...
    > Hello XSLT gurus,
    >
    > i've got a rather difficult problem. Some explanations first.
    > theres a signal oriented xml-file - the graphical represantation looks
    > like:
    >
    >
    > | startsignal (signal00)
    > \ /
    > ---------------------------------------------------------
    > | top | _________
    > part01 | | / \__
    > | down |____/ \_______________
    > --------------------------------------------------------
    > | top |______
    > part02 | | \
    > | down | \________________________
    > --------------------------------------------------------
    > | top | ______________________
    > part03 | | _____/
    > | down |________/
    > --------------------------------------------------------
    >
    >
    > all parts have got two states (top,down) with different values to
    > change
    > between the states:
    >
    > part01: 2 ticks up, 4 ticks down, starting position down
    > part02: 5 ticks up, 2 ticks down, starting position top
    > part03: 7 ticks up, 3 ticks down, starting position down
    >
    > lets assume the startsignal's name is "signal00"
    >
    > part01 requires signal00 and generates signal01
    > part02 requires signal01 and generates signal02
    > part03 requires signal02 and generates signal03
    > part01 requires signal03 and generates signal04
    >
    > the xml representation could be
    >
    > <project starttime="0" startsignal="signal00">
    > <element name="part01">
    > <positions>
    > <position name="top" duration="2" starting="false" />
    > <position name="down" duration="4" starting="true" />
    > </positions>
    > <signals>
    > <signal gen="signal01">
    > <and req="signal00" />
    > </signal>
    > <signal gen="signal04">
    > <and req="signal03" />
    > </signal>
    > </signals>
    > </element>
    >
    > <element name="part02">
    > <positions>
    > <position name="top" duration="5" starting="true" />
    > <position name="down" duration="2" starting="false" />
    > </positions>
    > <signals>
    > <signal gen="signal02">
    > <and req="signal01" />
    > </signal>
    > </signals>
    > </element>
    >
    > <element name="part03">
    > <positions>
    > <position name="top" duration="7" starting="false" />
    > <position name="down" duration="3" starting="true" />
    > </positions>
    > <signals>
    > <signal gen="signal03">
    > <and req="signal02" />
    > </signal>
    > </signals>
    > </element>
    > </project>
    >
    > still reading that veeery long post? :) thanks! now assume you want to
    > transform that
    > signal oriented xml-file into a timetick oriented one:
    >
    > part01: (0,0) (2,1) (11,1) (15,0)
    > part02: (0,1) (2,1) (4,0)
    > part03: (0,0) (4,0) (11,1)
    >
    > tricky, eh? i wan't post the corresponding java-code here (due to
    > size) but will make
    > it available on request at no time.
    >
    > thanks for playing with that problem
    >
    > yours
    > sebastian
     
    Dimitre Novatchev, Oct 28, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    736
    Stylus Studio
    Aug 3, 2004
  2. Oleg Konovalov

    For-each or recursion in XSLT

    Oleg Konovalov, May 14, 2005, in forum: Java
    Replies:
    1
    Views:
    624
    Danny
    Jun 4, 2005
  3. Oleg Konovalov

    For-each or recursion in XSLT

    Oleg Konovalov, May 14, 2005, in forum: XML
    Replies:
    1
    Views:
    1,033
    Danny
    Jun 4, 2005
  4. shaun roe
    Replies:
    3
    Views:
    952
    Dimitre Novatchev
    Sep 28, 2005
  5. Replies:
    8
    Views:
    783
    John Reye
    Apr 26, 2012
Loading...

Share This Page