M
Miel Bronneberg
Hi,
When I transform the following xml document
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE minim SYSTEM "http://www.cs.vu.nl/~embronne/XML/minim/minim.dtd">
<minim xmlns="http://www.cs.vu.nl/~embronne/XML/minim"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cs.vu.nl/~embronne/XML/minim
http://www.cs.vu.nl/~embronne/XML/minim/minim.xsd">
<lmnt>
<slmnt>1.one</slmnt>
</lmnt>
<lmnt>
<slmnt>2.one</slmnt>
</lmnt>
</minim>
using the following xslt stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Test database</title>
</head>
<body>
<h1>Minimal DataBase</h1>
<div>
Number of elements "lmnt":
<xsl:value-of select="count(minim/lmnt)"/>
</div>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="*">
</xsl:template>
</xsl:stylesheet>
it returns the following html document:
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test database</title>
</head>
<body>
<h1>Minimal DataBase</h1>
<div>
Number of elements "lmnt":
0</div>
</body>
</html>
Of course, this is the wrong number of elements. I can't figure this out.
What might help you figure it out, but puzzles me just as much, is that,
even though the xml document validates OK, both against the dtd and the
schema, the correct output is produced when I leave the doctype declaration
and the reference to the schema out of the xml document, like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<minim>
<lmnt>
<slmnt>1.one</slmnt>
</lmnt>
<lmnt>
<slmnt>2.one</slmnt>
</lmnt>
</minim>
What's going on here?
Thanks, regards, Miel.
When I transform the following xml document
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE minim SYSTEM "http://www.cs.vu.nl/~embronne/XML/minim/minim.dtd">
<minim xmlns="http://www.cs.vu.nl/~embronne/XML/minim"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cs.vu.nl/~embronne/XML/minim
http://www.cs.vu.nl/~embronne/XML/minim/minim.xsd">
<lmnt>
<slmnt>1.one</slmnt>
</lmnt>
<lmnt>
<slmnt>2.one</slmnt>
</lmnt>
</minim>
using the following xslt stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Test database</title>
</head>
<body>
<h1>Minimal DataBase</h1>
<div>
Number of elements "lmnt":
<xsl:value-of select="count(minim/lmnt)"/>
</div>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="*">
</xsl:template>
</xsl:stylesheet>
it returns the following html document:
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test database</title>
</head>
<body>
<h1>Minimal DataBase</h1>
<div>
Number of elements "lmnt":
0</div>
</body>
</html>
Of course, this is the wrong number of elements. I can't figure this out.
What might help you figure it out, but puzzles me just as much, is that,
even though the xml document validates OK, both against the dtd and the
schema, the correct output is produced when I leave the doctype declaration
and the reference to the schema out of the xml document, like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<minim>
<lmnt>
<slmnt>1.one</slmnt>
</lmnt>
<lmnt>
<slmnt>2.one</slmnt>
</lmnt>
</minim>
What's going on here?
Thanks, regards, Miel.