I'm writing an XSLT macro that should loop through a number of nodes and for each node display some data (description text and a picture). I want the list to be in a two-column table so I started out with the 'Table prototype' template. The problem is that I can't get the mix of XSLT tags and HTML tags to play along.
The code below can not be saved as it complains about unmatched tags and when I tried to replace every HTML tag, e.g. <td> with <td> the code saves and renders fine when I do 'Visualize XSLT' but running the macro in a real page renders the HTML tags (<td>) intead of interpreting them.
What would be the correct way of mixing XSLT and HTML tags?
One thing you need to know right away is that an XSLT file must be a wellformed XML file, so you can't conditionally output e.g. a close tag, like you're trying to.
You need to think differently about the output you're trying to generate - I've answered a couple of similar posts - one that fits your desired output would be this one, which explains how to go about generating table rows.
Mixing XSLT and HTML tags
I'm writing an XSLT macro that should loop through a number of nodes and for each node display some data (description text and a picture). I want the list to be in a two-column table so I started out with the 'Table prototype' template. The problem is that I can't get the mix of XSLT tags and HTML tags to play along.
The code below can not be saved as it complains about unmatched tags and when I tried to replace every HTML tag, e.g. <td> with <td> the code saves and renders fine when I do 'Visualize XSLT' but running the macro in a real page renders the HTML tags (<td>) intead of interpreting them.
What would be the correct way of mixing XSLT and HTML tags?
I'm running v4.5.2.
Hi Jonas,
One thing you need to know right away is that an XSLT file must be a wellformed XML file, so you can't conditionally output e.g. a close tag, like you're trying to.
You need to think differently about the output you're trying to generate - I've answered a couple of similar posts - one that fits your desired output would be this one, which explains how to go about generating table rows.
Hope it helps - otherwise, let us know!
/Chriztian
is working on a reply...