note 55029 added to function.xml-parse
| From: | markmeves at osu1 dot php dot net | Date: | Fri, 22 Jul 2005 19:57:12 +0000 |
| Subject: | note 55029 added to function.xml-parse | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92314@lists.php.net to get a copy of this message | ||
I'm working on improving these great, simple parsers too.
Will post soon.
Note that your whitespace logic should
be covered by using xml_parser_set_option(), (see)
and not done manually in your CDATA handler.
(make a method that wraps this and error checks
its result)
There are cases where you don't want to ignore whitespace,
for example to unparse an xml document (tree) and have it
maintain its readability. (as a string, not a structure)x
Consider, also, cases where you have
<div>some text <b>and some more</b> and then this</div>
How does your parser parse this above line?
If a parse tree node is comprised of
'attributes','cdata','children'
note that the above line has both
'children' and 'cdata'.
(i read somewhere once that this is problematic.
now i know why).
i am working on a solution to cover this.
I suggest either but the cdata as a string in
"children" in all cases (easiest) or a more complex solution
I won't elaborate on here.
Realize that we are re-inventing the DOM wheel
that has been solved hundreds of times.
Talk soon,
code till dawn,
mark d o t meves at gmail d o t com
----
Manual Page -- http://www.php.net/manual/en/function.xml-parse.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55029
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55029&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55029&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55029&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55029&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55029&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55029&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55029&report=yes
Search -- http://master.php.net/manage/user-notes.php