How to determine position in result

J

Johannes Koch

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top