By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,714 Members | 1,299 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,714 IT Pros & Developers. It's quick & easy.

BUG xslt test with a minus char in php & domxml

P: n/a
Hello,

When I try to do :

URI = <xsl:value-of select="//@URI"/><br/>
<xsl:if test = "//@URI != '5-42922'">not equal</xsl:if><br/>
<xsl:if test = "//@URI = '5-42922'">equal</xsl:if><br/>

The result is :

URI = 5-42922<br/>
not equal<br/>
equal<br/>
If I remove the - (minus) of my test, it's works fine !
Please, help me.

phpinfo() =

DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20606
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.0.33
libxslt compiled against libxml Version 2.5.11
DOM/EXSLT enabled
libexslt Version 1.0.33
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
srommens wrote:
When I try to do :

URI = <xsl:value-of select="//@URI"/><br/>
<xsl:if test = "//@URI != '5-42922'">not equal</xsl:if><br/>
<xsl:if test = "//@URI = '5-42922'">equal</xsl:if><br/>

The result is :

URI = 5-42922<br/>
not equal<br/>
equal<br/>
If I remove the - (minus) of my test, it's works fine !
Please, help me.


How do you transform the XML/XSLT? When I use the following, I'm getting the
expected result:

$proc = new xsltprocessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml);
JW

Jul 17 '05 #2

P: n/a
What is xsltprocessor ???
(http://fr2.php.net/manual-lookup.php...=xsltprocessor)

"Cannot instantiate non-existent class: xsltprocessor"

My code is :

$DomXml = file_get_contents("myxmlfile.xml",1);
$DomXml = @domxml_open_mem($DomXml,DOMXML_LOAD_PARSING +
DOMXML_LOAD_COMPLETE_ATTRS + DOMXML_LOAD_SUBSTITUTE_ENTITIES +
DOMXML_LOAD_DONT_KEEP_BLANKS);

$XslFile = "myxslfile.xsl";
$DomXsl = domxml_xslt_stylesheet_file($XslFile);

$result = $DomXsl->process($DomXml);
echo $DomXsl->result_dump_mem($result);
Jul 17 '05 #3

P: n/a
srommens wrote:
What is xsltprocessor ???
(http://fr2.php.net/manual-lookup.php...=xsltprocessor)

"Cannot instantiate non-existent class: xsltprocessor"


http://nl.php.net/xsl
JW

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.