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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml variable

Status
Not open for further replies.

josboogz

Programmer
Mar 5, 2003
12
0
0
GB
Hi all,

i am trying to use an xml variable for a value in an html img tag attribute. The variable holds the name of the image to insert.

Something along the lines of this but it doesnt like the syntax.

<IMG SRC=&quot;<xsl:value-of select=&quot;@url&quot;/>&quot; ALT=&quot;[Test image]&quot; align =&quot;center&quot;></IMG>

Can anyone help?

Thanks for your time.

jos
 
<IMG SRC=&quot;<xsl:value-of select=&quot;@url&quot;/>&quot; is not well formed XML.

XSLT must be well formed XML. You need to use the &quot;element&quot; and &quot;attribute&quot; XSLT elements to build nested tagged output.
Code:
<xsl::element name=&quot;IMG&quot;>
  <xsl::attribute name=&quot;SRC&quot;><xsl:value-of select=&quot;@url&quot;/></xsl:attribute>
</xsl::element>

If you need to build XSLT documents make sure you have access to a XSLT reference. The references will contain information about the XSLT command set.

-pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top