[thelist] XML + XSLT = XHTML

dante dante at vianet.net.au
Tue Jul 25 13:01:50 CDT 2000


After all the discussion on xhtml and after reading the articles mentioned I
thought that I would go have a look for myself.
I've been looking at how I would use xml as a designer working with a
developer.
I've been using xml Notepad from Littlefloppy & IE 5 to try to create a xml
to xhtml document.
It works fine with text (more or less) but I can't seem to work out why it
doesn't work for images.
Here is the XML I've been trying to use:
----------------------
<?xml version="1.0"?>
<?xml-stylesheet href="photo.xsl" type="text/xsl"?>

<!DOCTYPE list [
   <!ELEMENT photo EMPTY>
   <!ATTLIST photo name CDATA #REQUIRED>
   <!ATTLIST photo width CDATA #REQUIRED>
   <!ATTLIST photo height CDATA #REQUIRED>
   <!ATTLIST photo url CDATA #REQUIRED>
   <!ATTLIST photo border CDATA #REQUIRED>
   <!ATTLIST photo alt CDATA #REQUIRED>
   <!NOTATION GIF SYSTEM "">
]>

<list>
  <photo name="marker" src="marker.gif" width="300px" height="100px"
border="0" alt="marker" />
</list>
----------------------
& here is the XSLT
----------------------
<?xml version="1.0"?>
<xsl:stylesheet  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xsl:version='1.0'>
<xsl:template match="/">
   <xsl:apply-templates />
</xsl:template>
<xsl:template match="list">
   <html>
   <head>
 <title>Image</title>
   </head>
   <body>
<br />
<img name="{photo/@name}" src="{photo/@src}" width="{photo/@width}"
height="{photo/@height}" border="{photo/@border}" alt="{photo/@alt}" />
<xsl:apply-templates />
<br />
   </body>
   </html>
</xsl:template>
</xsl:stylesheet>
----------------------

I'm completely baffled & can't find what I need from the w3 site or xml.com
et. al.
Any suggestions would be helpful.

Thanks,
            dante






More information about the thelist mailing list