How to determine position in result

Discussion in 'XML' started by Johannes Koch, Jul 8, 2003.

  1. Given this XML

    <a>
    <b>
    <d/><!-- may occur here -->
    <e/>
    </b>
    <c>
    <f/><!-- may occur here -->
    <g/>
    </c>
    </a>

    I'd like to put the contents of d, e, f, and g into an HTML table row,
    with the following order:

    <tr>
    <td><!-- if f occurs in XML, otherwise no td -->
    <f/>
    </td>
    <td><!-- if d occurs in XML, otherwise no td -->
    <d/>
    </td>
    <td>
    <e/>
    </td>
    <td>
    <g/>
    </td>
    </tr>

    Additionally, if f occurs in XML, put an attribute to its td, otherwise
    if d occurs in XML, put an attribute to its td, otherwise put an
    attribute to e's td. In other words, the first td in the result sould
    get the attribute.
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Jul 8, 2003
    #1
    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. J.Ram
    Replies:
    7
    Views:
    681
  2. Pavel
    Replies:
    7
    Views:
    563
    Pavel
    Sep 19, 2010
  3. Lakshmi Sreekanth

    i = 10; result = ++i - --i; How result become ZERO

    Lakshmi Sreekanth, Sep 21, 2010, in forum: C Programming
    Replies:
    52
    Views:
    1,238
    Nick Keighley
    Sep 23, 2010
  4. Peña, Botp
    Replies:
    1
    Views:
    263
    Robert Klemme
    Jan 24, 2004
  5. Michael Tan
    Replies:
    32
    Views:
    1,079
    Ara.T.Howard
    Jul 21, 2005
Loading...

Share This Page