Re: [xml] Indent - please help

Date view Thread view Subject view Author view

From: Nilo S. Mismetti (nilo@newpos.com)
Date: Thu Sep 28 2000 - 08:04:50 EDT


(by adding text nodes containing the formatting).

How can I do this?

Nilo

----- Original Message -----
From: "Daniel Veillard" <Daniel.Veillard@w3.org>
To: <xml@rpmfind.net>
Sent: Quarta-feira, 27 de Setembro de 2000 19:51
Subject: Re: [xml] Indent - please help

>
> On Wed, Sep 27, 2000 at 06:17:24PM -0300, Nilo S. Mismetti wrote:
> >
> > I'm using LibXML to parse several documents and works fine.
> >
> > Now I'm trying to add a new node and works, except that when I save the
> > result my additions appears on a single line:
> >
> > <PosDB><UserID><User01>3,1,86</User01></UserID></PosDB>
>
> How is that a problem ;-) ?
>
> > To add new nodes <UserID> and <User01> I'm using:
> >
> > if((curSection=xmlNewChild(BaseSection,NULL,lpAppName,NULL)) == NULL)
> > return(0);
> > if((curKey=xmlNewTextChild(curSection,NULL,lpKeyName,Valor)) == NULL)
> > return(0);
> >
> > lpAppName == "UserID"
> > lpKeyName == "User01"
> > Valor == "3,1,86"
> >
> > To write the XML file I'm using:
> >
> > xmlIndentTreeOutput=TRUE;
> > xmlSetDocCompressMode(doc,CompressLevel);
> > return((xmlSaveFile(FileName,doc) == -1) ? TRUE : FALSE);
> >
> > A little help will be VERY useful.
>
> All blanks are significant in XML. Hence they are not dropped
> at import and not added automatically. You can disable this by using
> xmlKeepBlanksDefault(0); but think seriously about it first. The
> right solution might be to actually insert the blanks instead
> (by adding text nodes containing the formatting).
>
> Daniel
>
> --
> Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes | Today's Bookmarks :
> Tel : +33 476 615 257 | 655, avenue de l'Europe | Linux XML libxml WWW
> Fax : +33 476 615 207 | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
> http://www.w3.org/People/all#veillard%40w3.org | RPM badminton Kaffe
> ----
> Message from the list xml@rpmfind.net
> Archived at : http://xmlsoft.org/messages/
> to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net
>

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Sep 28 2000 - 09:43:33 EDT