Anybody have Sablotron working with a recent PHP?
| From: | Rasmus Lerdorf | Date: | Sat, 04 May 2002 11:14:43 +0000 |
| Subject: | Anybody have Sablotron working with a recent PHP? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-83688@lists.php.net to get a copy of this message | ||
A quick test of various versions of Sablotron with HEAD:
0.90 Sablotron error on line 1: unknown encoding ''
0.81 Sablotron error on line 1: unknown encoding ''
0.71 Sablotron error on line 1: unknown encoding ''
0.65
/home/rasmus/php4/ext/xslt/sablot.c:198: undefined reference to
`SablotCreateProcessorForSituation'
0.52
In file included from /home/rasmus/php4/ext/xslt/sablot.c:27:
/home/rasmus/php4/ext/xslt/php_sablot.h:96: parse error before
`SablotSituation'
/home/rasmus/php4/ext/xslt/php_sablot.h:96: warning: no semicolon at end
of struct or union
/home/rasmus/php4/ext/xslt/php_sablot.h:99: parse error before `}'
/home/rasmus/php4/ext/xslt/php_sablot.h:114: field `processor' has
incomplete type
/home/rasmus/php4/ext/xslt/php_sablot.h:118: confused by earlier errors,
bailing out
0.44
Trouble building Sablotron itself because of expat issues
The test script was:
$p = xslt_create();
$res = xslt_process($p,'foo.xml','foo.xsl');
if(!$res) echo xslt_error($p);
echo $res;
xslt_free($p);
foo.xml:
<?xml version="1.0" encoding="utf-8"?>
<data>
<item type="1">abc</item>
<item type="2">efg</item>
</data>
foo.xsl:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet
version="1.0"
xmlns:xsl="Transform">
<xsl:output method="xml" indent="yes"
omit-xml-declaration="yes"/>
<xsl:param name="par01"/>
<xsl:template match="/">
<xsl:apply-templates select="data"/>
</xsl:template>
<xsl:template match="data">
<html>
<body bgcolor='#e0ffe0'>
<h2>result:</h2>
<ul>
<xsl:for-each select="item">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
<li>
<xsl:value-of select="$par01"/>
</li>
<li>
<xsl:value-of select="document('arg:/data2')/data/item"/>
</li>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
(Yes, I downloaded the Transform file - not that it matters)
-Rasmus