I'm sure this problem has been worked out many times before, but my experience with XSLT apparently isn't good enough to allow me to see how to do the following:
say the XML looks something like this:
I need my XSLT to render a table that looks like:
Can this be done in pure XSLT? Should it be done in XSLT, or do you need server side code?
to manipulated using procedural rather than declarative methods? Does anyone know of a pattern or a similar example I can reference to help me get what I need?
The following html rendering is NOT acceptable: (i got this far to work in my XSLT, but it's not what is called for in the spec)
Uncommitted, except to looking good. Constantly judging.
Always on the verge of being upset.
say the XML looks something like this:
Code:
<events>
<event>
<name>concert</name>
<date>today</date>
<time></time>
<location>New Jersey</location>
</event>
<event>
<name>book signing</name>
<date></date>
<time></time>
<location>New York</location>
</event>
</events>
I need my XSLT to render a table that looks like:
Code:
<table>
[COLOR=red](this part is easy. I know the XML will always render two values here)[/color]
<tr>
<th>concert</th>
<th>book signing</th>
</tr>
[COLOR=red](here's where it gets tricky and where I lose grasp of how to get what I want. - not all elements have values, and it needs to be dynamic - I want, in the case of this example, the book signing location to render at the cell in the top right of the table instead of bottom right, and the &nsbp' s to follow at the end)[/color]
<tr>
<td>date: today</td>
<td>location: New York</td>
</tr>
<tr>
<td>location: New Jersey</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<tr>
</table>
Can this be done in pure XSLT? Should it be done in XSLT, or do you need server side code?
to manipulated using procedural rather than declarative methods? Does anyone know of a pattern or a similar example I can reference to help me get what I need?
The following html rendering is NOT acceptable: (i got this far to work in my XSLT, but it's not what is called for in the spec)
Code:
<table>
<tr>
<th>concert</th>
<th>book signing</th>
</tr>
<tr>
<td>date: today</td>
<td> </td>
</tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>location: New Jersey</td>
<td>location: New York</td>
<tr>
</table>
Uncommitted, except to looking good. Constantly judging.
Always on the verge of being upset.