xsl-list
[Top] [All Lists]

Top Level Element Error

2004-11-07 20:23:18

I kept getting "...Only one top level element is
allowed in an XML document. Error processing resource"
even though I have checked many times that there is
only one top level element which is <xsl:stylesheet>
Can someone help? Here's the xslt file.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:dc="http://purl.org/dc/elements/1.1/";>
        <xsl:import href="footer.xsl"/>
        <xsl:import href="menubarv.xsl"/>
        <xsl:import href="menubarh.xsl"/>
        <xsl:import href="header.xsl"/>
        <xsl:output method="html"/>
        <xsl:template match="/">
                <html>
                        <head>
                                <title>Tinnitus RSS News Feeds</title>
                                <meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"/>
                                <link rel="stylesheet" href="../style/style.css"
type="text/css"/>
                                <link rel="stylesheet"
href="../style/cascademenu.css" type="text/css"/>
                        </head>
                        <body bgcolor="#8080C0" link="#6666FF"
vlink="#6666FF" alink="#CCCCCC">
                                <xsl:call-template name="header"/>
                                <table width="100%" border="0" align="center"
cellpadding="10">
                                        <xsl:call-template name="menubarh"/>
                                        <tr bgcolor="#6699FF">
                                                <xsl:call-template 
name="menubarv"/>
                                                <td bgcolor="#FFFFFF" 
valign="top" height="400">
                                                        <div align="left">
                                                                <p 
align="center">
                                                                        <font 
face="Verdana, Arial, Helvetica,
sans-serif" size="3">
                                                                                
<br/>
                                                                                
<b>Tinnitus News Links</b>
                                                                        </font>
                                                                </p>
                                                                <font 
face="Verdana, Arial, Helvetica,
sans-serif" size="2">
                                                                        
<xsl:apply-templates
select="document('http://www.medicinenet.com/rss/specialty/Tinnitus.xml')"/>
                                                                </font>
                                                        </div>
                                                </td>
                                        </tr>
                                </table>
                                <xsl:call-template name="footer"/>
                        </body>
                </html>
        </xsl:template>
        <xsl:template match="*[local-name()='channel']">
                <xsl:element name="a">
                        <xsl:attribute name="href"><xsl:apply-templates
select="*[local-name()='link']"/></xsl:attribute>
                        <xsl:attribute name="title"><xsl:apply-templates
select="*[local-name()='description']"/></xsl:attribute>
                        <xsl:value-of select="*[local-name()='title']"/>
                </xsl:element>
                <xsl:apply-templates
select="*[local-name()='item']"/>
        </xsl:template>
        <xsl:template match="*[local-name()='item']">
                <xsl:element name="a">
                        <xsl:attribute name="href"><xsl:apply-templates
select="*[local-name()='link']"/></xsl:attribute>
                        <xsl:attribute name="title"><xsl:apply-templates
select="*[local-name()='description']"/></xsl:attribute>
                        <xsl:value-of select="*[local-name()='title']"/>
                </xsl:element>
                <xsl:text> </xsl:text>
                <xsl:if test="dc:date">
                        <xsl:text>( </xsl:text>
                        <xsl:value-of select="dc:date"/>
                        <xsl:text>) </xsl:text>
                </xsl:if>
        </xsl:template>
</xsl:stylesheet>






                
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 



<Prev in Thread] Current Thread [Next in Thread>