Sablotron error
Moderator: General Moderators
Sablotron error
Hi...
I'm working on XML files where are stored in a MySQL database. With PHP I intend to transform these XML with XSLT. After much difficulty, I managed to sort out everything until the portion about xslt_process. The browser
returns:
Warning: Sablotron error on line 2: 'arg:/argument.dtd' not found in /home/httpd/html/ctan/resultworkingcopy2.php on line 91 XSLT processing error: 'arg:/argument.dtd' not found
Anyone have any idea what's going on? I'd appreciate any help I can get on this. Thanks in advance.
Chia
I'm working on XML files where are stored in a MySQL database. With PHP I intend to transform these XML with XSLT. After much difficulty, I managed to sort out everything until the portion about xslt_process. The browser
returns:
Warning: Sablotron error on line 2: 'arg:/argument.dtd' not found in /home/httpd/html/ctan/resultworkingcopy2.php on line 91 XSLT processing error: 'arg:/argument.dtd' not found
Anyone have any idea what's going on? I'd appreciate any help I can get on this. Thanks in advance.
Chia
The xslt file would be something like this:

The xml file would be stored in a query and called up via MySQL. It shoul look something like this:<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!--<xsl:template match="ARG">
<html><body>
<xsl:apply-templates/>
</body></html>
</xsl:template>
-->
<!-- This is the title of the page -->
<xsl:template match="CQ">
<b><u>
<xsl:value-of select="."/>
</u></b>
</xsl:template>
<xsl:template match="PROP">
<p/><b>
<xsl:value-of select="."/>
</b><br/>
</xsl:template>
</xsl:stylesheet>
Just in case you might want to look at the .php file as well...:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ARG SYSTEM "argument.dtd">
<ARG>
<SCHEMESET>
<SCHEME>
<NAME>Argument from Position to Know</NAME>
<FORM>
<PREMISE>a is in a position to know whether A is true</PREMISE>
<PREMISE>a asserts that A is true</PREMISE>
<CONCLUSION>A is true</CONCLUSION>
</FORM>
<CQ>Is a in a position to know whether A is true?</CQ>
<CQ>Is a an honest (trustworthy, reliable) source?</CQ>
<CQ>Did a actually assert that A is true?</CQ>
</SCHEME>
</SCHEMESET>
<!-- The Text of the AML-->
<TEXT>If any journalists learn about the invasion, then the newspapers will print the news. And if the newspapers print the news, then the invasion will not be a secret. If the invasion is not a secret, then our troops will not have the advantage of surprise. If we do not have the advantage of surprise, then the enemy will be prepared. And if the enemy is prepared, then we are likely to suffer higher casualties. But no journalists learned about the invasion. Therefore, we are not likely to suffer higher casualties.</TEXT>
<!-- The components of the argument-->
<AU>
<PROP identifier="C" missing="no">
<PROPTEXT offset="367">we are likely to suffer higher casualties</PROPTEXT>
</PROP>
<REFUTATION>
<AU>
<PROP identifier="A" missing="no">
<PROPTEXT offset="468">we are not likely to suffer higher casualties</PROPTEXT>
</PROP>
</AU>
</REFUTATION>
<CA>
<AU>
<PROP identifier="D" missing="no">
<PROPTEXT offset="304">the enemy will be prepared</PROPTEXT>
</PROP>
<CA>
<AU>
<PROP identifier="F" missing="no">
<PROPTEXT offset="202">our troops will not have the advantage of surprise</PROPTEXT>
</PROP>
<CA>
<AU>
<PROP identifier="G" missing="no">
<PROPTEXT offset="171">invasion is not a secret</PROPTEXT>
</PROP>
<LA>
<AU>
<PROP identifier="I" missing="no">
<PROPTEXT offset="0">If any journalists learn about the invasion</PROPTEXT>
</PROP>
<REFUTATION>
<AU>
<PROP identifier="B" missing="no">
<PROPTEXT offset="413"> no journalists learned about the invasion</PROPTEXT>
</PROP>
</AU>
</REFUTATION>
</AU>
<AU>
<PROP identifier="H" missing="no">
<PROPTEXT offset="93">the newspapers print the news</PROPTEXT>
</PROP>
</AU>
</LA>
</AU>
</CA>
</AU>
</CA>
</AU>
</CA>
</AU>
</ARG>
Hope things are clearer now. Thanks again for your time and help.if (! empty($searchword ))
$query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
$result = mysql_query($query)
or die ("Query failed");
$line = mysql_fetch_array($result, MYSQL_ASSOC);
// Create an array
$xml = join($line,'');
$arguments = array('/_xml'=> $xml);
$xsl = "sheet1.xsl";
// Show information about the variable
var_dump($xml);
// Create an XSLT processor
$xslthandler = xslt_create();
// Perform the transformation
$html = xslt_process($xslthandler, 'arg:/_xml', $xsl, NULL, $arguments);
// Detect errors
if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler));
// Destroy the XSLT processor
xslt_free($xslthandler);
// Output the resulting HTML
print "<pre>$html</pre>";
-
adrianciobanu
- Forum Newbie
- Posts: 5
- Joined: Tue Jul 30, 2002 5:31 am
regarding to your problem, i'm begining to wander if sablotron supports any including system at all!! Because, the same error you get with dtd, i get with a xsl:include/import in the stylesheet. Maybe it has some weird system of searching for files, i don't know.
As a very don't_do_it_at_home solution, you may embed the dtd in the xml document, i don't know. I can do that with my xsl, but it sucks!!!
Maybe we should raise a BUG to the development team. (In fact i was thinking to take a look in the sources of the xslt extension.)
As a very don't_do_it_at_home solution, you may embed the dtd in the xml document, i don't know. I can do that with my xsl, but it sucks!!!
Maybe we should raise a BUG to the development team. (In fact i was thinking to take a look in the sources of the xslt extension.)
-
adrianciobanu
- Forum Newbie
- Posts: 5
- Joined: Tue Jul 30, 2002 5:31 am