Creating an hyperlink via XSL Transformation

M

Muhammed Inam

Hi,

Suppose I have the following recurring XML data:
<sgv>
<items>
<item id="5400" ugl_nr="1122" description="....."> </item>
<item id="5420" ugl_nr="112222" description="....."> </item>
<item id="5421" ugl_nr="1332" description="....."> </item>
</items>
</sgv>

And, I like this XML data to be converted into:

... HTML Tags ..
<table>
<tr>
<td><a href="bes:desc?id=5400&ugl_nr=1122"> {description} </a></td>
<td><a href="bes:desc?id=5420&ugl_nr=112222"> {description}
</a></td>
<td><a href="bes:desc?id=5421&ugl_nr=1332"> {description} </a></td>
</tr>
</table>


So, how can I do this? (Especially, link portion)

Thanks
 
A

Andy Fish

Muhammed Inam said:
Hi,

Suppose I have the following recurring XML data:
<sgv>
<items>
<item id="5400" ugl_nr="1122" description="....."> </item>
<item id="5420" ugl_nr="112222" description="....."> </item>
<item id="5421" ugl_nr="1332" description="....."> </item>
</items>
</sgv>

And, I like this XML data to be converted into:

.. HTML Tags ..
<table>
<tr>
<td><a href="bes:desc?id=5400&ugl_nr=1122"> {description}
<td><a href="bes:desc?id=5420&ugl_nr=112222"> {description}
</a></td>
<td><a href="bes:desc?id=5421&ugl_nr=1332"> {description}
</tr>
</table>


So, how can I do this? (Especially, link portion)

Thanks

off the top of my head

<xsl:template match="items/item>
<a href="bes:desc?id={@id}&ugl_nr={@ugl_nr}"><xsl:value-of
select="description"/></a>
</xsl:template>
 
A

Andy Fish

btw, although crossposting is sometimes frowned upon, it is far better to
crosspost than to post the same message separately to two different groups
 

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,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top