G
Guest
Hi All,
I wrote a TOC treeview using xml and xslt, with help from this forum and
MSDN help(thanks)
Great in IE 6. (expect IE 5 as well, articles were circa 2000)
However, Mozilla FireFox (latest), gives me the following error.
" Error Loading Stylesheet: Parsing an XSLT stylesheet failed "
And the Mozilla forums have no answer, so... hopefully here !
TIA
Neal
beneath is the XSLT and some of the XML (which invokes the XSLT)
The XML:
<?xml-stylesheet type='text/xsl' href='listN.xsl'?>
<CategoriesList>
<Categories>
<CategoryDescr>Vehicles</CategoryDescr>
<CategoryId>1</CategoryId>
<SubCategories>
<SubCatDescr>OnRoad</SubCatDescr>
<SubCatId>1</SubCatId>
<SubSubCategories>
<SubSubCatDescr>2ndHand</SubSubCatDescr>
<SubSubCatId>1</SubSubCatId>
<URL>MainAds.aspx?Vehicles?OnRoad?2ndHand</URL>
</SubSubCategories>
<SubSubCategories>
<SubSubCatDescr>New</SubSubCatDescr>
<SubSubCatId>2</SubSubCatId>
<URL>MainAds.aspx?Vehicles?OnRoad?New</URL>
</SubSubCategories>
</SubCategories>
<SubCategories>
<SubCatDescr>ATV</SubCatDescr>
<SubCatId>4</SubCatId>
<URL>MainAds.aspx?Vehicles?ATV</URL>
</SubCategories>
</Categories>
<Categories>
<CategoryDescr>Books</CategoryDescr>
<CategoryId>2</CategoryId>
<SubCategories>
<SubCatDescr>StudentTexts</SubCatDescr>
<SubCatId>9</SubCatId>
<SubSubCategories>
<SubSubCatDescr>CourseAndYear</SubSubCatDescr>
<SubSubCatId>11</SubSubCatId>
<URL>MainAds.aspx?Books?StudentTexts?CourseAndYear</URL>
</SubSubCategories>
</SubCategories>
</Categories>
</CategoriesList>
XSLT :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<LINK REL="stylesheet" TYPE="text/css" HREF="list.css" />
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript" SRC="listN.js"></SCRIPT>
</HEAD>
<BODY>
<BUTTON ONCLICK="ShowAll('UL')">Show All</BUTTON>
<BUTTON ONCLICK="HideAll('UL')">Hide All</BUTTON>
<H1><xsl:value-of select="CategoriesList/@TYPE" /></H1>
<UL><xsl:apply-templates select="CategoriesList/Categories" /></UL>
<!--- <UL><xsl:apply-templates
select="CategoriesList/Categories/SubCategories" /></UL> -->
</BODY>
</HTML>
</xsl:template>
<xsl:template match="Categories">
<LI CLASS="clsHasKids">
<xsl:value-of select="CategoryDescr" />
<xsl:if test="SubCategories">
<UL>
<xsl:for-each select="SubCategories">
<LI CLASS="clsHasKids">
<xsl:value-of select="SubCatDescr" />
<xsl:if test="SubSubCategories">
<UL>
<xsl:for-each select="SubSubCategories">
<LI>
<A TARGET="main">
<xsl:attribute name="HREF">
<xsl:value-of select="URL"/>
</xsl:attribute>
<xsl:value-of select="SubSubCatDescr" />
</A>
</LI>
</xsl:for-each>
</UL>
</xsl:if>
</LI>
</xsl:for-each>
</UL>
</xsl:if>
</LI>
<xsl:if test="Categories">
<xsl:apply-templates />
</xsl:if>
</xsl:template>
</xsl:stylesheet>
I wrote a TOC treeview using xml and xslt, with help from this forum and
MSDN help(thanks)
Great in IE 6. (expect IE 5 as well, articles were circa 2000)
However, Mozilla FireFox (latest), gives me the following error.
" Error Loading Stylesheet: Parsing an XSLT stylesheet failed "
And the Mozilla forums have no answer, so... hopefully here !
TIA
Neal
beneath is the XSLT and some of the XML (which invokes the XSLT)
The XML:
<?xml-stylesheet type='text/xsl' href='listN.xsl'?>
<CategoriesList>
<Categories>
<CategoryDescr>Vehicles</CategoryDescr>
<CategoryId>1</CategoryId>
<SubCategories>
<SubCatDescr>OnRoad</SubCatDescr>
<SubCatId>1</SubCatId>
<SubSubCategories>
<SubSubCatDescr>2ndHand</SubSubCatDescr>
<SubSubCatId>1</SubSubCatId>
<URL>MainAds.aspx?Vehicles?OnRoad?2ndHand</URL>
</SubSubCategories>
<SubSubCategories>
<SubSubCatDescr>New</SubSubCatDescr>
<SubSubCatId>2</SubSubCatId>
<URL>MainAds.aspx?Vehicles?OnRoad?New</URL>
</SubSubCategories>
</SubCategories>
<SubCategories>
<SubCatDescr>ATV</SubCatDescr>
<SubCatId>4</SubCatId>
<URL>MainAds.aspx?Vehicles?ATV</URL>
</SubCategories>
</Categories>
<Categories>
<CategoryDescr>Books</CategoryDescr>
<CategoryId>2</CategoryId>
<SubCategories>
<SubCatDescr>StudentTexts</SubCatDescr>
<SubCatId>9</SubCatId>
<SubSubCategories>
<SubSubCatDescr>CourseAndYear</SubSubCatDescr>
<SubSubCatId>11</SubSubCatId>
<URL>MainAds.aspx?Books?StudentTexts?CourseAndYear</URL>
</SubSubCategories>
</SubCategories>
</Categories>
</CategoriesList>
XSLT :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<LINK REL="stylesheet" TYPE="text/css" HREF="list.css" />
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript" SRC="listN.js"></SCRIPT>
</HEAD>
<BODY>
<BUTTON ONCLICK="ShowAll('UL')">Show All</BUTTON>
<BUTTON ONCLICK="HideAll('UL')">Hide All</BUTTON>
<H1><xsl:value-of select="CategoriesList/@TYPE" /></H1>
<UL><xsl:apply-templates select="CategoriesList/Categories" /></UL>
<!--- <UL><xsl:apply-templates
select="CategoriesList/Categories/SubCategories" /></UL> -->
</BODY>
</HTML>
</xsl:template>
<xsl:template match="Categories">
<LI CLASS="clsHasKids">
<xsl:value-of select="CategoryDescr" />
<xsl:if test="SubCategories">
<UL>
<xsl:for-each select="SubCategories">
<LI CLASS="clsHasKids">
<xsl:value-of select="SubCatDescr" />
<xsl:if test="SubSubCategories">
<UL>
<xsl:for-each select="SubSubCategories">
<LI>
<A TARGET="main">
<xsl:attribute name="HREF">
<xsl:value-of select="URL"/>
</xsl:attribute>
<xsl:value-of select="SubSubCatDescr" />
</A>
</LI>
</xsl:for-each>
</UL>
</xsl:if>
</LI>
</xsl:for-each>
</UL>
</xsl:if>
</LI>
<xsl:if test="Categories">
<xsl:apply-templates />
</xsl:if>
</xsl:template>
</xsl:stylesheet>