Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL namespace

Status
Not open for further replies.

TheTTsHereAreNice

Programmer
Mar 4, 2007
3
US
I have four files they all work fine and validate except my xsl.


The error reads, unable to locate a refrence to a supported schema type. (DTD W3C schema) within this document instance.

Here are the names of my files and thanks for all your efforts.


booklist.xml
booksxsl.xsl
bookscss.css
books.xsd


this how my XML looks (booklist.xml)

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="booksxsl.xsl"?>
<booklist xmlns:xsi=" xsi:noNamespaceSchemaLocation="books.xsd">
<book>
<title>The Big Sleep</title>
<picture> the_big_sleep.jpg</picture>
<author> Raymond Chandler</author>
<year>1939</year>
<price>$11.65</price>
<review>The review will go here.</review>
</book>
<book>
<title>Beloved</title>
<picture>beloved.jpg</picture>
<author>Toni Morrison </author>
<year>1987</year>
<price>$13.95</price>
<review>The review will go here.</review>
</book>
<book>
<title>All the King's Men</title>
<picture>all_the_kings_men.jpg</picture>
<author> Robert Penn Warren </author>
<year> 1946 </year>
<price> $15.00</price>
<review>The review will go here.</review>
</book>
<book>
<title>Native Son </title>
<picture>native_son.jpg</picture>
<author>Richard Wright</author>
<year>1940</year>
<price>$14.95</price>
<review>The review will go here.</review>
</book>
<book>
<title>Lord of the Flies</title>
<picture>lord_of_the_flies.jpg</picture>
<author>William Golding</author>
<year>1955</year>
<price>$9.99 </price>
<review>The review will go here.</review>
</book>
<book>
<title>One Flew Over the Cuckoo's Nest </title>
<picture>one_flew_over_the_cuckoos_nest.jpg</picture>
<author>Ken Kesey </author>
<year>1962</year>
<price>$7.99</price>
<review>The review will go here.</review>
</book>
<book>
<title>The Power and the Glory </title>
<picture>the_power_and_the_glory.jpg</picture>
<author>Graham Greene</author>
<year>1939</year>
<price>$14.00</price>
<review>The review will go here.</review>
</book>
<book>
<title>Gone With the Wind</title>
<picture>gone_with_the_wind.jpg</picture>
<author>Margaret Mitchell</author>
<year>1936</year>
<price>$18.00</price>
<review>The review will go here.</review>
</book>
<book>
<title>The Catcher in the Rye</title>
<picture>the_catcher_in_the_rye.jpg</picture>
<author> J.D. Salinger</author>
<year>1951</year>
<price>$13.95</price>
<review>The review will go here.</review>
</book>
<book>
<title>The Lion, The Witch and the Wardrobe</title>
<picture>the_lion_the_witch_and_the_wardrobe.jpg</picture>
<author>C.S. Lewis</author>
<year>1950</year>
<price>$16.99</price>
<review>The review will go here.</review>
</book>
</booklist>


----------------------------------------
Here my xsl
--------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="
<xsl:template match="/">
<html>
<head>

<title> Famous Books</title>

<link rel="stylesheet" href="bookscss.css"/>
</head>

<body>
<h2>Famous Books</h2>
<xsl:for-each select="//book">

<div id="booklist">
<h1><xsl:value-of select="title"/></h1>
<p class="img"> <img src="{picture}"/></p>
<p class="author">Author: <xsl:value-of select="author"/> </p>
<p class="year">Year: <xsl:value-of select="year"/> </p>
<p class="price">Price: <xsl:value-of select="price"/> </p>
<p class="review">Review: <xsl:value-of select="review"/> </p></div>
</xsl:for-each>
</body>
</html>
</xsl:template>

</xsl:stylesheet>






--------------------------------------
Here is my CSS
---------------------------------------

body {font-family:Arial, helvetica, sans-serif;
background-color: #272727;


display: block;
padding: 10pt;
border: 2px solid #E73131;
margin: 5px;
text-align: left;
}

div#booklist
{
width:450px;
background-color: #A6BFD8;
font-weight: bold;
font-size: 12pt;
display:block;
border: 4px solid #5F8CBA;
margin-bottom: 36px;
}


h1 {
color: #cbfdd5;
font-weight: bold;
font-size: 16pt;
padding: top 10px;
display:block;
margin-bottom: 5px;
text-align:center;

}

h2 {
color: #A6BFD8;
font-weight: bold;
font-size: 30pt;
display:block;
margin-bottom: 5px;
text-align:center;
margin-bottom:72px;

}
.author {
font-weight: bold;
font-size: 12pt;
display:block;
padding: 10pt;
}


.year {
font-weight: bold;
font-size: 12pt;
display:block;
padding: 10pt;
}
.price{

font-size: 12pt;
font-weight: bold;
display:block;
padding: 10pt;
}
.img {padding:10pt;display:block;}
isbno {

font-size: 12pt;
display: block;

}
.review {font-size: 12pt; padding: 10pt;}

-----------------------------------
Here is my xsd
-----------------------------------

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd=" <xsd:element name="booklist">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="book" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="picture" type="xsd:string"/>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="year" type="xsd:string"/>
<xsd:element name="price" type="xsd:string"/>
<xsd:element name="review" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
 
On their own, the document seems validated and displayed just fine. The problem might be attributed to something else edited out and not shown here. Those source files should all be located in the same directory.
 
I didn't mentioned that they are all in one folder but no matter what i do; it just can't find it. I get the same error unable to locate a reference to a supported schema type. (DTD W3C schema) within this document instance.
 
What I was trying to do was validate my XSL. However, what I learned in school today... is that you can't validate XSL. (i hope it's true)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top