note 43202 added to function.xml-parse-into-struct
| From: | sdh33atcornelldotedu at rn2 dot php dot net | Date: | Mon, 14 Jun 2004 02:04:46 +0000 |
| Subject: | note 43202 added to function.xml-parse-into-struct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71023@lists.php.net to get a copy of this message | ||
I used the algorithm from stephane for writing back to a file, but ran into the following problem.
My original XML looks like
<ENTRY id="1"> ... </ENTRY><ENTRY id="2"> ... </ENTRY>
This got saved back as
<1> ... </1><2> ... </2>,
which expat doesn't agree with. So I propose the following modification. Right after the
"foreach" in writeXmlToFile, I add
if (preg_match("/\A[0-9]/",$name)) {
$name = "ENTRY id=\"$name\"";
}
where clearly the "ENTRY" would need to fit whatever the intended use. It's a small
fix, but could help.
----
Manual Page -- http://www.php.net/manual/en/function.xml-parse-into-struct.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43202
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43202&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43202&report=yes
Search -- http://master.php.net/manage/user-notes.php