No, this is not what I want. The xmlKeepBlanksDefault function removes blank nodes. My XML document contains a node with whitespaces. It's not a blank node. So, it doesn't remove my whitespaces.
There is a solution using the libxslt library and applying a stylesheet to the document... But I am wondering if there is a way to do this job using just libxml2. Have you any idea about this? ----- Mail original ----- De: "Michael Ludwig" <[email protected]> À: [email protected] Envoyé: Mardi 14 Février 2012 22:43:37 Objet: Re: [xml] Remove whitespaces from text nodes Laurence Rowe schrieb am 14.02.2012 um 20:58 (+0000): > On 14 February 2012 09:59, <[email protected]> wrote: > > I would like to have this output (without editing my XML file) : > > "My book "A"" > > "My book "B"" > > "My book "C"" > > > > The useless whitespaces are removed from text nodes. > > > > Is there a function which do this work? > > Take a look at the xmllint source, it has a --noblanks option which > sets xmlKeepBlanksDefault(0); But that doesn't get rid of non-ignorable whitespace. $ xmllint --version xmllint: using libxml version 20708 Michael _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
