I'm trying to figure out how to use an external entity.
I'm trying to display some info in a web browser. (I'm using firefox 1.5.0.8)
Using a simple xml file and xsl file (posted below) I can display the info:
--------test1.xml--------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href=http://www.webdeveloper.com/forum/archive/index.php/"test0.xsl"?>
<catalog>
<cd>
<title>slave driver</title>
<artist>bob marley</artist>
</cd>
</catalog>
--------test0.xsl-----------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Favorite Song</h2>
<h3><xsl:value-of select="catalog/cd/title"/></h3>
<h4><xsl:value-of select="catalog/cd/artist"/></h4>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
But what I want to do is use an external entity like this:
--------test1.xml--------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test0.xsl"?>
<!DOCTYPE catalog [
<!ENTITY test2 SYSTEM "test2.xml">
]>
<catalog>
<cd>
&test2;
</cd>
</catalog>
--------test2.xml--------------
<title>slave driver</title>
<artist>bob marley</artist>
Can anyone explain what I'm doing wrong?
Thanks.
I'm trying to display some info in a web browser. (I'm using firefox 1.5.0.8)
Using a simple xml file and xsl file (posted below) I can display the info:
--------test1.xml--------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href=http://www.webdeveloper.com/forum/archive/index.php/"test0.xsl"?>
<catalog>
<cd>
<title>slave driver</title>
<artist>bob marley</artist>
</cd>
</catalog>
--------test0.xsl-----------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Favorite Song</h2>
<h3><xsl:value-of select="catalog/cd/title"/></h3>
<h4><xsl:value-of select="catalog/cd/artist"/></h4>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
But what I want to do is use an external entity like this:
--------test1.xml--------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test0.xsl"?>
<!DOCTYPE catalog [
<!ENTITY test2 SYSTEM "test2.xml">
]>
<catalog>
<cd>
&test2;
</cd>
</catalog>
--------test2.xml--------------
<title>slave driver</title>
<artist>bob marley</artist>
Can anyone explain what I'm doing wrong?
Thanks.