Ok, so I thought I'd dabble my feet in XML with PHP tonight. Very simple thing I'm trying to do. Get the latest version of some software.
I wrote the following DTD and called it sketchpadcopyright.dtd:
Then I wrote this XML file called sketchpadcopyright.xml:Code:<?xml version="1.0" encoding="UTF-8"?> <!ELEMENT copyright (currentversion)> <!ELEMENT currentversion (#PCDATA)>And the following XSL stylesheet called sketchpadcopyright.xslCode:<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="http://www.emmense.com/xmlfeed/sketchpadcopyright.xsl"?> <!DOCTYPE copyright SYSTEM "http://www.emmense.com/xmlfeed/sketchpadcopyright.dtd"> <copyright> <currentversion>0.1</currentversion> </copyright>and followed some code I found in one of KEvin's articles:Code:<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" /> <xsl:template match="/copyright"> <p> <xsl:value-of select="currentversion"></xsl:value-of> </p> </xsl:template> </xsl:stylesheet>And I can't figure out why I'm getting this error:PHP Code:<?php
$xsltproc = xslt_create();
$html= xslt_process($xsltproc,'sketchpadcopyright.xml','sketchpadcopyright.xsl');
if(!$html)
{
exit(xslt_error($xsltproc));
}
xslt_free($xsltproc);
echo $html;
?>
(http://www.emmense.com/xmlfeed/sketchpadcopyright.php)Warning: Sablotron error on line 1: XML parser error 4: not well-formed (invalid token) in /home/sketch/public_html/xmlfeed/sketchpadcopyright.php on line 3
XML parser error 4: not well-formed (invalid token)
What gives? :\





Bookmarks