I'm a newbie to XML/XSL - but I can't seem to solve a simple problem. I'm trying to use XSL to sort output (preferably in an apply-templates). When I use <xsl:stylesheet xmlns:xsl=" version="1.0">
it's as if someone turns the lights out. I get nothing. If I change back to <xsl:stylesheet xmlns:xsl=" version="1.0">
then I at least get output - but can't use sort with that namespace. I'm using IE 5.5. Is there a problem with IE 5.5 and XSL?
Below are my xml ans xsl.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<booklist>
<book isbn="72-80081-082">
<title>The Gourmet Microwave</title>
<publisher>New Moon Books</publisher>
<price>9.95</price>
<details>Details.asp?isbn=72-80081-082</details>
<author>Charlotte M. Cooper</author>
<author>Shelley B. Burke</author>
<author>Regina P. Murphy</author>
</book>
<book isbn="72-80081-024">
<title>Sushi, Anyone?</title>
<publisher>New Moon Books</publisher>
<price>14.99</price>
<details>Details.asp?isbn=72-80081-024</details>
<author>Charlotte M. Cooper</author>
<author>Yoshi Nagase</author>
</book>
<book isbn="9-001-122-12">
<title>The Busy Executive's Database Guide</title>
<publisher>Binnet and Hardley</publisher>
<price>19.95</price>
<details>Details.asp?isbn=9-001-122-12</details>
<author>Mayumi Ohno</author>
</book>
<book isbn="9-001-122-90">
<title>Cooking With Computers: Surreptitous Balance Sheet</title>
<publisher>Binnet and Hardley</publisher>
<price>11.95</price>
<details>Details.asp?isbn=9-001-122-90</details>
<author>Mayumi Ohno</author>
<author>Ian H. Devling</author>
<author>Peter Wilson II</author>
<author>Lars Peterson</author>
</book>
<book isbn="9-001-122-01">
<title>Straight Talk About Computers</title>
<publisher>Binnet and Hardley</publisher>
<price>19.99</price>
<details>Details.asp?isbn=9-001-122-01</details>
<author>Lars Peterson</author>
</book>
</booklist>
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match="/">
<xsl:apply-templates select="//book"/>
</xsl:template>
<xsl:template match="book">
<xsl:apply-templates select="title"/>
<xsl:apply-templates select="price"/>
<xsl:apply-templates select="author"/>
</xsl:template>
<xsl:template match="title">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="price">
<I><xsl:value-of select="."/></I>
</xsl:template>
<xsl:template match="author">
<I><xsl:value-of select="."/></I>
</xsl:template>
</xsl:stylesheet>
Thanks for any help you can give.
Tim Ryan
it's as if someone turns the lights out. I get nothing. If I change back to <xsl:stylesheet xmlns:xsl=" version="1.0">
then I at least get output - but can't use sort with that namespace. I'm using IE 5.5. Is there a problem with IE 5.5 and XSL?
Below are my xml ans xsl.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<booklist>
<book isbn="72-80081-082">
<title>The Gourmet Microwave</title>
<publisher>New Moon Books</publisher>
<price>9.95</price>
<details>Details.asp?isbn=72-80081-082</details>
<author>Charlotte M. Cooper</author>
<author>Shelley B. Burke</author>
<author>Regina P. Murphy</author>
</book>
<book isbn="72-80081-024">
<title>Sushi, Anyone?</title>
<publisher>New Moon Books</publisher>
<price>14.99</price>
<details>Details.asp?isbn=72-80081-024</details>
<author>Charlotte M. Cooper</author>
<author>Yoshi Nagase</author>
</book>
<book isbn="9-001-122-12">
<title>The Busy Executive's Database Guide</title>
<publisher>Binnet and Hardley</publisher>
<price>19.95</price>
<details>Details.asp?isbn=9-001-122-12</details>
<author>Mayumi Ohno</author>
</book>
<book isbn="9-001-122-90">
<title>Cooking With Computers: Surreptitous Balance Sheet</title>
<publisher>Binnet and Hardley</publisher>
<price>11.95</price>
<details>Details.asp?isbn=9-001-122-90</details>
<author>Mayumi Ohno</author>
<author>Ian H. Devling</author>
<author>Peter Wilson II</author>
<author>Lars Peterson</author>
</book>
<book isbn="9-001-122-01">
<title>Straight Talk About Computers</title>
<publisher>Binnet and Hardley</publisher>
<price>19.99</price>
<details>Details.asp?isbn=9-001-122-01</details>
<author>Lars Peterson</author>
</book>
</booklist>
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match="/">
<xsl:apply-templates select="//book"/>
</xsl:template>
<xsl:template match="book">
<xsl:apply-templates select="title"/>
<xsl:apply-templates select="price"/>
<xsl:apply-templates select="author"/>
</xsl:template>
<xsl:template match="title">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="price">
<I><xsl:value-of select="."/></I>
</xsl:template>
<xsl:template match="author">
<I><xsl:value-of select="."/></I>
</xsl:template>
</xsl:stylesheet>
Thanks for any help you can give.
Tim Ryan