xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lyle Coder" <x_co...@hotmail.com>
Subject Re: Help for XML + XSL -> HTML
Date Wed, 03 Jan 2001 13:41:50 GMT
You have the name space decleration wrong:

Use the following line instead of the one you have
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/strict">

Lyle

----- Original Message -----
From: "Hui Zhao" <hzhao@globe.net.nz>
To: <general@xml.apache.org>
Sent: Friday, January 19, 2001 2:21 PM
Subject: Help for XML + XSL -> HTML


> Hello,
>
> I use James Clark's XSL processor xt to convert XML file into HTML format.
> The HTML file I get is not what I expected, it doesn't show the content
text
> from the XML source, just print all the XSL stylesheet , someone can
figure
> it out for me, please.
> Here is my XML source file:
> *********************************************************
> <?xml version="1.0"?>
> <!--DOCTYPE sampleXML SYSTEM "sampleXML.dtd"-->
> <sampleXML>
> <!-- ++++ The header part of the document ++++ -->
> <front>
> <to>Mano</to>
> <date>Next Friday Evening at 8 pm</date>
> <where>The Web Cafe</where>
> <why>My first XML sample</why>
> </front>
> <!-- +++++ The main part of the document +++++ -->
> <body>
> <par>
> I would like to invite you all to celebrate
> the birth of <emph>Invitation</emph>, my
> first XML document child.
> </par>
> <par>
> Please do your best to come and join me next Friday
> evening. And, do not forget to bring your friends.
> </par>
> <par>
> I <emph>really</emph> look forward to see you soon!
> </par>
> </body>
> <!-- +++ The closing part of the document ++++ -->
> <back>
> <signature>Hui</signature>
> </back>
> </sampleXML>
> **********************************************************
>
> The following is XSL stylesheet:
> **********************************************************
> <?xml version='1.0'?>
> <xsl:stylesheet
>  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
>  xmlns="http://www.w3.org/TR/REC-html40"
>  result-ns="">
>
> <xsl:template match="sampleXML">
> <html>
> <head>
> <title> My first XML (XSL/CSS formatting) </title>
> </head>
> <body>
> <h1>My first XML sample </h1>
> <table>
> <tbody>
> <tr><td class="front">To: </td>
> <td><xsl:value-of select="@to"/></td></tr>
> <tr><td class="front">When: </td>
> <td><xsl:value-of select="@date"/></td></tr>
> <tr><td class="front">Venue: </td>
> <td><xsl:value-of select="@where"/></td></tr>
> <tr><td class="front">Occasion: </td>
> <td><xsl:value-of select="@why"/></td></tr>
> </tbody>
> </table>
> <xsl:apply-templates/>
> <p class="signature"><xsl:value-of select="@signature"/></p>
> </body>
> </html>
> </xsl:template>
>
> <xsl:template match="sampleXML/par">
> <p><xsl:apply-templates/></p>
> </xsl:template>
>
> <xsl:template match="sampleXML/par/emph">
> <em><xsl:apply-templates/></em>
> </xsl:template>
>
> </xsl:stylesheet>
> *******************************************************************
> Here is the HTML file I get after the processing.
> *****************************************************************
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet result-ns=""
xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
> xmlns="http://www.w3.org/TR/REC-html40"><xsl:template
> match="sampleXML"><html><head><title> My first XML (XSL/CSS formatting)
> </title><link href="invit.css" rel="stylesheet"
> type="text/css"/></head><body><h1>My first XML sample
> </h1><table><tbody><tr><td class="front">To: </td><td><xsl:value-of
> select="@to"/></td></tr><tr><td class="front">When: </td><td><xsl:value-of
> select="@date"/></td></tr><tr><td class="front">Venue:
> </td><td><xsl:value-of select="@where"/></td></tr><tr><td
> class="front">Occasion: </td><td><xsl:value-of
> select="@why"/></td></tr></tbody></table><xsl:apply-templates/><p
> class="signature"><xsl:value-of
> select="@signature"/></p></body></html></xsl:template><xsl:template
>
match="sampleXML/par"><p><xsl:apply-templates/></p></xsl:template><xsl:templ
> ate
>
match="sampleXML/par/emph"><em><xsl:apply-templates/></em></xsl:template></x
> sl:stylesheet>
>
>
> Thanks
>
> Hui
>
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
>
>

Mime
View raw message