[thelist] XML + XSLT = XHTML

Peter-Paul Koch ppk at xs4all.nl
Wed Jul 26 02:27:05 CDT 2000


<list>
  <photo name="marker" src="marker.gif" width="300px" height="100px"
border="0" alt="marker" />
</list>
----------------------

You don't need a DTD for IE5 (though it is allowed). I don't think that
making a mistake in the DTD gives trouble for the XSL.

----------------------
<img name="{photo/@name}" src="{photo/@src}" width="{photo/@width}"
height="{photo/@height}" border="{photo/@border}" alt="{photo/@alt}" />

Try something like:

<img>
 <xsl:attribute name="name">
  <xsl:value-of select="photo/@name">
 </xsl:attribute>
 <xsl:attribute name="src">
  <xsl:value-of select="photo/@src">
 </xsl:attribute>
 etc.
</img>

Not sure if this will work, it's a long time ago I did XSL. The photo/@src
bit may also give problems, then write a template for showing the img, like

<xsl:template match="photo">
<img>
 <xsl:attribute name="name">
  <xsl:value-of select="@name">
 </xsl:attribute>
 <xsl:attribute name="src">
  <xsl:value-of select="@src">
 </xsl:attribute>
</xsl:template>
etc.
</img></xsl:template>

For a practical example of XML/XSL, see

http://www.netlinq.nl/interest

I made this a year ago, so I can't tell you everything about it, but it's a
working XML/XSL example.

ppk




More information about the thelist mailing list