[ wxwindows-Patches-1550397 ] Save and load CDATA in XML files
SourceForge.net
noreply at sourceforge.net
Fri Sep 1 02:10:17 PDT 2006
Patches item #1550397, was opened at 2006-09-01 11:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1550397&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: bug fix
Status: Open
Resolution: None
Priority: 5
Submitted By: Håkan Wiman (hakan_wiman)
Assigned to: Nobody/Anonymous (nobody)
Summary: Save and load CDATA in XML files
Initial Comment:
The wxXmlNode and wxXmlDocument wrappers around Expat
do not save or load <![CDATA[ *** ]]> sections. This
path fixes it.
Although, it has long been said that wxXmlDocument will
(may) be deprecated, I like this simple framework and
use it for a lot of xml based stuff. Therefore, it is a
crucial enhancement to be able to save and load CDATA
sections. The fix should be self-explanatory, but here
goes:
* When writing a node of type wxXML_CDATA_SECTION_NODE
we just add "<![CDATA[" followed by the content
(without entity replacements) and a trailing "]]>".
* When loading a CDATA section we:
1.) Add a handler StartCdataHnd which sets a bool flag,
bLastCdata, in the user data context to true and
creates an wxXML_CDATA_SECTION_NODE node and set it as
the lastAsText node.
2.) When the TextHnd handler is activated we check i
bLastCdata is true, in which case we *DO NOT* parse the
content, just add it as content to the
wxXML_CDATA_SECTION_NODE node.
3.) As the EndCdataHnd is activated we set bLastCdata
to false.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1550397&group_id=9863
More information about the wx-dev
mailing list