ID:               16193
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         XSLT related
 Operating System: windows2000
 PHP Version:      4.1.2
 New Comment:

System:
- Windows 2000
- Apache 1.3.24, Apache Release 10324100
- PHP as apache module
- PHP 4.3.0-dev
- Xslt Support enabled

Discussed earlier on bugs.php.net i found the code below, which is said
to work. Running the script in command line mode I get - always - the
same error:

C:\www\www-xml>php -f test.php

Warning: Sablotron error on line 1: XML parser error 3: no element
found in test.php on line 23

Line 23 is the line with $xh = xslt_create();.

-urs

--
<?php
// http://bugs.php.net/bug.php?id=16993

$xml = <<< END
<?xml version="1.0" encoding="ISO-8859-2"?>
<ROOT>
<IMPORTANT>Very important ö ü é </IMPORTANT>
</ROOT>
END;

$xsl = <<<END
<?xml version="1.0" encoding="ISO-8859-2"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="html"/>
<xsl:template match="ROOT">
  <B><xsl:value-of select="IMPORTANT"/></B>
</xsl:template>
</xsl:stylesheet>
END;

$arguments = array('/_xml' => $xml,'/_xsl' => $xsl);
$xh = xslt_create();
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments
);
echo $result;
?>


Previous Comments:
------------------------------------------------------------------------

[2002-03-20 17:24:23] [EMAIL PROTECTED]

The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php

------------------------------------------------------------------------

[2002-03-20 17:19:28] [EMAIL PROTECTED]

Here is the error:
Warning: Sablotron error on line 1: XML parser error 4: not well-formed
(invalid token) in
c:\Inetpub\wwwroot\localData\tools\xml\example\xsl\xml.php on line 7
Error: XML parser error 4: not well-formed (invalid token)

Now the code imma going to show has been tried many different ways all
with the exact same error message.

Here is one sample of the php code...

$xh = xslt_create();
$args = array();
$params = array( 'foo' => 'bar' );
$result = xslt_process($xh,
'c:\Inetpub\wwwroot\localData\tools\xml\example\xsl\xml.xml','c:\Inetpub\wwwroot\localData\tools\xml\example\xsl\xml.xml',NULL,
$args,$params);
if ($result)
{
 print $result;
} else {
 print "Error: ".xslt_error($xh);
}
@xslt_free($xh);
exit;


here is the xml.xml

<?xml version="1.0"?>
<catalog>
        <cd>
                <title>str_title</title>
                <artist>str_artist</artist>
        </cd>
</catalog>


here is the xsl.xsl file

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html" indent="yes" encoding="utf-8"/>
<xsl:template match="/">
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>
<xsl:value-of select="artist"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


I have no idea what is going on here.  Read the peeps where able to run
this on windows but no go here.  Maybe my dlls are baffed????

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=16193&edit=1

Reply via email to