ID: 24474
Updated by: rrichards@php.net
Reported By: grest at interia dot pl
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
Operating System: WinXp
PHP Version: 4.3.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
open the file using domxml_open_file($fileName, DOMXML_LOAD_VALIDATING)
in order to process the DTD
Previous Comments:
------------------------------------------------------------------------
[2003-07-04 05:05:51] grest at interia dot pl
I replaced the polish characters with normal character, but it still
doesn`t work.
------------------------------------------------------------------------
[2003-07-03 06:04:38] grest at interia dot pl
I`ve checked this out, and this is not the reason.
------------------------------------------------------------------------
[2003-07-03 05:26:34] sniper@php.net
Your xml is not valid:
# /usr/bin/xmllint filmy.xml
filmy.xml:5: error: Input is not proper UTF-8, indicate encoding !
<TITLE>13 Duchów</TITLE>
^
filmy.xml:5: error: Bytes: 0xF3 0x77 0x3C 0x2F
<TITLE>13 Duchów</TITLE>
^
------------------------------------------------------------------------
[2003-07-03 05:18:31] grest at interia dot pl
del.php
<?php
$fileName = "filmy.xml";
$fid = $HTTP_POST_VARS['deltitle'];
if(!$dom = domxml_open_file($fileName)) {
echo "Error while parsing the document\n";
exit;
}
$node = $dom->get_element_by_id($fid);
$parent = $node->parent_node();
$delnode = $parent->remove_child($node);
$dom->dump_file("filmy.xml", true);
$filename = "filmy.xsl";
$xmldoc = domxml_open_file("filmy.xml");
$xsldoc = domxml_xslt_stylesheet_file($filename);
$result = $xsldoc->process($xmldoc);
print $xsldoc->result_dump_mem($result);
?>
filmy.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE LIST SYSTEM "filmy.dtd">
<LIST>
<MOVIE ID="m20036271138360">
<TITLE>13 Duchów</TITLE>
<ORGTITLE/><LOC>Grzesiek HDD</LOC>
<INFO/>
</MOVIE>
<MOVIE ID="m20036271138361">
<TITLE>8 kobiet</TITLE>
<ORGTITLE/>
<LOC>Grzesiek HDD</LOC>
<INFO/>
</MOVIE>
</LIST>
simply.html:
<html>
<body>
<form action="del.php" method="post" style="margin:0px">
<input type="hidden" name="deltitle" size="1"
value="m20036271138360"><input type="image" name="Delete"
src="del.gif">
</form>
</body>
</html>
I`m sure that 'deltitle' and $fid variable are correct "connected"
(sorry for my English :P ), but get_element_by_id doesn`t find the node
in XML file(filmy.xml)
------------------------------------------------------------------------
[2003-07-03 04:57:25] derick@php.net
Please provide a FULL self-contained script which should work when we
copy and paste it into a file and run it with php <filename>. This is
useles.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/24474--
Edit this bug report at http://bugs.php.net/?id=24474&edit=1