xsl-list
[Top] [All Lists]

Access denied

2004-11-07 08:42:57
I have a xsl file and a xml file. The xml contains 2
RSS feed URLs. I use the xsl file to transform the RSS
feed into HTML which lists the items of the feed. But
I got an error message:

 "The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please
correct the error and then click the Refresh button,
or try again later. 
--------------------------------------------------------------------------------
Access is denied. Error processing resource
'file://Users/zjwsun/Sites/hrl/xsl/getRSS.xsl'. " 

I don't know what is wrong. Thanks for any help.

Here's the XML:
<?xml version="1.0"?>
<?xml-stylesheet
href="/Users/zjwsun/Sites/hrl/xsl/getRSS.xsl"
type="text/xsl"?>

<RSSChannels>
  <RSSChannel
src="http://www.tinnitus-research.org/atr.xml"/>
  <RSSChannel
src="http://www.medicinenet.com/rss/specialty/Tinnitus.xml"/>
</RSSChannels>

Here's the XSL:
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:dc="http://purl.org/dc/elements/1.1/";
version="1.0">
        <xsl:output method="html" encoding="iso-8859-1"/>
        <xsl:template match="RSSChannels">
                <html>
                        <head>
                                <title>Today's Headlines</title>
                        </head>
                        <body>
                                <xsl:apply-templates/>
                        </body>
                </html>
        </xsl:template>
        <xsl:template match="RSSChannel">
                <xsl:apply-templates select="document(@src)"/>
        </xsl:template>
        <!-- Named template outputs HTML a element with href
link and RSS
       description as title to show up in mouseOver
message. -->
        <xsl:template name="a-element">
                <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:template>
        <!-- Output RSS channel name as HTML a link inside of
h1 element. -->
        <xsl:template match="*[local-name()='channel']">
                        <xsl:call-template name="a-element"/>
                <!-- Following line for RSS .091 -->
                <xsl:apply-templates
select="*[local-name()='item']"/>
        </xsl:template>
        <!-- Output RSS item as HTML a link inside of p
element. -->
        <xsl:template match="*[local-name()='item']">
                        <xsl:call-template name="a-element"/>
                        <xsl:text> </xsl:text>
                        <xsl:if test="dc:date">
                                <!-- Show date if available -->
                                <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>