Re: [xml] Remove whitespaces from text nodes

2012-03-14 Thread Earnie Boyd
2012/2/16 Georges-André SILBER : > and you want to get Some text you can still use the function below > and "strip" every text node with a C function (I don't think that a standard > C function exists for that). > Example code at http://www.redantigua.com/c-ex-beginner-trim.html -- Earnie -- h

Re: [xml] Remove whitespaces from text nodes

2012-03-14 Thread Georges-André SILBER
> De: "Georges-André SILBER" > À: "spam spam spam spam" > Cc: xml@gnome.org > Envoyé: Jeudi 16 Février 2012 09:14:17 > Objet: Re: [xml] Remove whitespaces from text nodes > > Hi, > > I wrote a small function for this purpose some time ago. > I didn&

Re: [xml] Remove whitespaces from text nodes

2012-03-14 Thread Georges-André SILBER
paces... > This is the reason why I would like to use an already defined function. > > Is there a function which do this job? > > - Mail original - > De: "Liam R E Quin" > À: "spam spam spam spam" > Cc: xml@gnome.org > Envoyé: Jeudi 16 Févrie

Re: [xml] Remove whitespaces from text nodes

2012-03-14 Thread Eric S. Eberhard
void stripSpaces(xmlNodePtr node) //likely pass in the "children" of the root { int len,i; for (;node;node=node->next) { if (node->type == XML_TEXT_NODE) { len = strlen(node->name); for (i=0;iname[i] != ' ') break; if (i >

Re: [xml] Remove whitespaces from text nodes

2012-02-17 Thread Michael Ludwig
spam.spam.spam.s...@free.fr schrieb am 16.02.2012 um 08:57 (+0100): > Yes you are right. > But I am not sure my function will do a good job. > I know 2 whitespaces : " ", "\t", ... But I am not sure that I know > all of them. > My function will probably forgot to strip some whitespaces... > This is

Re: [xml] Remove whitespaces from text nodes

2012-02-16 Thread spam . spam . spam . spam
"spam spam spam spam" Cc: xml@gnome.org Envoyé: Jeudi 16 Février 2012 10:02:23 Objet: Re: [xml] Remove whitespaces from text nodes OK, but in this case it really depends on your input XML format and what you consider "useless". If you only have "locally" useless whitespa

Re: [xml] Remove whitespaces from text nodes

2012-02-16 Thread spam . spam . spam . spam
À: "spam spam spam spam" Cc: xml@gnome.org Envoyé: Jeudi 16 Février 2012 09:14:17 Objet: Re: [xml] Remove whitespaces from text nodes Hi, I wrote a small function for this purpose some time ago. I didn't test it with the last versions of libxml2 nor did I ensure that this code if c

Re: [xml] Remove whitespaces from text nodes

2012-02-15 Thread spam . spam . spam . spam
unction. Is there a function which do this job? - Mail original - De: "Liam R E Quin" À: "spam spam spam spam" Cc: xml@gnome.org Envoyé: Jeudi 16 Février 2012 08:40:31 Objet: Re: [xml] Remove whitespaces from text nodes On Thu, 2012-02-16 at 08:28 +0100, spam.spam.sp

Re: [xml] Remove whitespaces from text nodes

2012-02-15 Thread Liam R E Quin
On Thu, 2012-02-16 at 08:28 +0100, spam.spam.spam.s...@free.fr wrote: > [...]. > Anyway, there seems to have no other solution with libxml2 only. The spaces are part of the text of the document, so it's not likely that a conformant XML parser will strip them for you. You could of course remove th

Re: [xml] Remove whitespaces from text nodes

2012-02-15 Thread spam . spam . spam . spam
yet tested this solution. Anyway, there seems to have no other solution with libxml2 only. Thanks for your help. - Mail original - De: "Liam R E Quin" À: "spam spam spam spam" Cc: "Michael Ludwig" , xml@gnome.org Envoyé: Mercredi 15 Février 2012 16:13:03 Objet:

Re: [xml] Remove whitespaces from text nodes

2012-02-15 Thread Michael Ludwig
spam.spam.spam.s...@free.fr schrieb am 15.02.2012 um 10:00 (+0100): > But now, I am wondering if there is a solution just using libxml2 > (without libxslt). > In fact, I am requesting for a transformation of the XML document. > Indeed, the original node contains whitespaces and I want to remove >

Re: [xml] Remove whitespaces from text nodes

2012-02-15 Thread Liam R E Quin
On Wed, 2012-02-15 at 10:04 +0100, spam.spam.spam.s...@free.fr wrote: > 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? Use My Book C without

Re: [xml] Remove whitespaces from text nodes

2012-02-15 Thread spam . spam . spam . spam
. 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" À: xml@gnome.org Envoyé: Mardi 14 Février 2012 22:43:37 Objet: Re: [xml] Remove whitespaces from text nodes Laurence Rowe schrieb am

Re: [xml] Remove whitespaces from text nodes

2012-02-15 Thread spam . spam . spam . spam
org Envoyé: Mardi 14 Février 2012 21:13:19 Objet: Re: [xml] Remove whitespaces from text nodes spam.spam.spam.s...@free.fr schrieb am 14.02.2012 um 10:59 (+0100): > I write a C program using the libxml2 library. > I would like to have this output (without editing my XML file) : > "My bo

Re: [xml] Remove whitespaces from text nodes

2012-02-14 Thread Michael Ludwig
Laurence Rowe schrieb am 14.02.2012 um 20:58 (+): > On 14 February 2012 09:59, 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 fun

Re: [xml] Remove whitespaces from text nodes

2012-02-14 Thread Laurence Rowe
On 14 February 2012 09:59, wrote: > Hello, > > I write a C program using the libxml2 library. > It takes as argument an input XML file and it displays the content at the > screen. > > This is the input file : > >                        author="Erich Gamma" >                editor="Addison Wesle

Re: [xml] Remove whitespaces from text nodes

2012-02-14 Thread Piotr Sipika
On 02/14/2012 03:13 PM, Michael Ludwig wrote: > spam.spam.spam.s...@free.fr schrieb am 14.02.2012 um 10:59 (+0100): >> Is there a function which do this work? > > Don't know the C API, but in XSLT there's the function normalize-space() > and it does just what you want, so you might want to take a

Re: [xml] Remove whitespaces from text nodes

2012-02-14 Thread Michael Ludwig
spam.spam.spam.s...@free.fr schrieb am 14.02.2012 um 10:59 (+0100): > I write a C program using the libxml2 library. > 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

[xml] Remove whitespaces from text nodes

2012-02-14 Thread spam . spam . spam . spam
Hello, I write a C program using the libxml2 library. It takes as argument an input XML file and it displays the content at the screen. This is the input file : My book "A" My book "B" My book "C"