cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Re: XML error.
Date Fri, 12 Nov 2004 07:40:27 GMT
This error typically occurs when you have an XML doc that looks like:

<?xml version="1.0"?>
<page>
</page>
<other>
</other>

ie. there is not one root tag for the page.

>>> orosmith@sify.com 2004/11/12 09:39:28 AM >>>
I have an XSL to generate an XML. However the following error was
seen.

What does this error mean??
Only one top level element is allowed in an XML document. Line 6,
Position 6 
 

    <rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
-----^

The XSL i used is given below:


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:template match="news">
        <rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/">
        <channel>
        <title>xx.com News</title>
        <link>http://xx.com/news_info/news</link>
        <description>Latest News from xx.com</description>
        <language>en-us</language>
        <lastBuildDate><xsl:value-of select="dt" /></lastBuildDate>
        <pubDate><xsl:value-of select="dt" /></pubDate>
        <image>
        <title>yy.com</title>
        <url>http://yyimg.speedera.net/yy.com/images/yylogo.gif</url>
        <link>http://www.yy.com/</link>
        </image>
        <xsl:for-each select="headline">
                <item>
                <title><xsl:value-of select="title" /></title>
                <link>http://yy.com/news/fullstory.php?id=<xsl:value-of
select="tid" /></link>
                <description><xsl:value-of select="desc"
/></description>
                <dc:date><xsl:value-of select="pubdate" /></dc:date>
                </item>
        </xsl:for-each>
        </channel>
        </rss>
  </xsl:template>
</xsl:stylesheet>



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message