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

xslt and img

Status
Not open for further replies.

stasJohn

Programmer
May 6, 2004
155
US
the code is simple enough

<xsl:stylesheet ... >
<xsl:eek:utput method="html" />
<xsl:template match="/">
<xsl:for-each select="//image">
<img src="{@path}" alt="" width="300" height="255" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

When the img tag is printed out, it is not closed, which is invalid. That is, it outputs <img ... > instead of <img ... />

If I change the output method to xml, it outputs the img tag correctly, but it outputs "<?xml version="1.0" encoding="UTF-8"?>" at the beginning.

Any idea how to output a valid img tag?

thanks in advance.

 
I answered my own question above...

<xsl:eek:utput method="xml" encoding="utf-8" indent="no"
omit-xml-declaration="yes" media-type="text/html"/>

the "omit-xml-decleration" keeps "<?xml version="1.0" encoding="UTF-8"?>" from being outputted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top