============ Forwarded message ============
From : jaayer To : "Jan van de Sandt" Date : Mon, 09 Aug 2010 14:55:29 -0700 Subject : Re: Squeaksource XML Parser - Enhanced support for CDATA Sections ============ Forwarded message ============
---- On Mon, 09 Aug 2010 04:44:07 -0700 Jan van de Sandt wrote ----
Hello,
Ok, I understand the problem :-) thanks for explaining it.
Here is a new version. In this version the XMLDOMParser has an extra property preserveCDATASections so the behaviour is now configurable. For now the default value of this property is true.
Thank you for the patch. I have merged it in, but with the following modifications: 1) Preservation of CDATA sections is disabled by default, as most of the time you don't really care whether parsed character data originally contained &, < or other pseudoentities to escape special characters or if those special characters were guarded within a CDATA section. 2) #addCDATASection: has not been added. I really don't want a proliferation of #add* methods in XMLElement or XMLNodeWithElements for every node type. #addContent: is special, as it accepts a node or a string, and #addElement; was once needed for the special handling element nodes required but is no longer needed. #addNode: should be preferred. 3) The messages added to XMLDOMParser were renamed to #isInCDataSection, #preservesCDataSections, and #preservesCDataSections: to make it clearer that they take or return boolean values. Here is an example that demonstrates parsing with CDATA section preservation: doc := (XMLDOMParser on: '') preservesCDataSections: true; parseDocument. doc root firstNode When evaluated with cmd-p, it produces: