All preservesIgnorableWhitespace: does now is preserve whitespace as string nodes in elements of type element content as indicated by a DTD with ELEMENT declarations that restricts their content to elements. That's why toggling the setting didn't do anything for you when you parsed a doc with no DTD and ELEMENT declarations (I will adapt the #ignorableWhitespace: comment for #preservesIgnorableWhitespace: to explain this more).
Sent: Monday, April 25, 2016 at 6:55 AM From: "Cyril Ferlicot Delbecque" <cyril.ferlicot@gmail.com> To: pharo-dev@lists.pharo.org Subject: Re: [Pharo-dev] XMLParser changes
On 25/04/2016 12:30, Norbert Hartl wrote:
It is right. There is no characters to be skipped. These must all resolve to text nodes with the whitespace characters in it. The behaviour of the new version is correct. So if you indent XML documents you might change the structure. The property should give control over that behaviour is called PreserveWhiteSpace.
Norbert
Ok thank you. Now I need to find how to disable it. :) I tried
((XMLDOMParser on: '<?xml version="1.0" encoding="UTF-8"?> <!--clones description file--> <Clones> <ClonedFragment cloneName="test"> <Member fileName="ProgramA"/> <Member fileName="ProgramB"/> </ClonedFragment> <ClonedFragment cloneName="test2"> <Member fileName="ProgramA"/> <Member fileName="ProgramB"/> </ClonedFragment> </Clones>') preservesIgnorableWhitespace: false; parseDocument) elements first nodes
but I still get the whitespaces.
I did not do a lot of XML parsing, someone knows how to remove easily all the whitespaces nodes in a document?
-- Cyril Ferlicot
165 Avenue Bretagne Lille 59000 France