WDDX Character data
| From: | Andrew Smith | Date: | Wed, 03 May 2000 23:57:40 +0000 |
| Subject: | WDDX Character data | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-14436@lists.php.net to get a copy of this message | ||
Is it possible to have the serialize functions in WDDX escape "<" and
"&"
since at the moment strings containing those characters get serialised
correctly but cause the deserialize function to fall over.
Normally this wouldn't be a problem since when creating the structures
before serialisation I can escape them myself, however I'm currently
serialising trees and when I unserialise them to edit a node, expat changes
all my & and < to & and <. This means that even though I'm only
editing one node in the tree I have to parse every other node to escape the
special characters before serialising the structure again.
I'm not all that experienced at reading DTD's but from what I can gather
since in WDDX strings are not stored between <![CDATA[]]>, then section 2.4
of the XML 1.0 spec (http://www.w3.org/TR/REC-xml#syntax) says that "<" and
"&" *must* be escaped. Can anyone more experienced shed some light on
whether this is possible/desirable in the php implementation? Is it allowed
by the WDDX DTD? Would it break much existing code? Does an #implied CDATA
section not have to escape them, just like a real CDATA? and I guess most
importantly will it cause problems for other implementations of WDDX?
Andrew