[thelist] XML + XSLT = XHTML

elkay lwkraemer at earthlink.net
Tue Jul 25 15:31:09 CDT 2000


Maybe... Your DTD defines photo attribute 'url', but you are using 'src' in
your xml and xsl?

----- Original Message -----
From: "dante" <dante at vianet.net.au>
To: <thelist at lists.evolt.org>
Sent: Tuesday, July 25, 2000 10:43 AM
Subject: [thelist] XML + XSLT = XHTML


> 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
>
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
>





More information about the thelist mailing list