Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding attribute to an element

Status
Not open for further replies.

eclipsetalk

Programmer
Nov 15, 2008
2
Hello,
I want to create a XSLT transform to convert an XML to another XML to add attribute to elements such as:

I need to transform:

<node>
<Title>Hotel</Title>
<image>//files/hotel.png</image>
</node>

to:

<node>
<Title>Hotel</Title>
<image href="//files/hotel.png"></image>
</node>

I think that I need to add <xsl:attribute name="href">//files/hotel.png</xsl:attribute> but I don't know how to define the rest of the xslt file.
Thanks in advance for any help with this novice question...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top