Re: LibXML2 Indentation



On Wed, 2003-04-30 at 00:23, Havoc Pennington wrote:
> > <stringvalue>9</stringvalue>
> ...
> >   <stringvalue>
> >    9
> >   </stringvalue>
> 
> The difference is that in the second case the string stored is "\n 9\n
> " and in the first case it is "9".  If you didn't do this, you
> couldn't store strings containing whitespace.

Yes right, I could have thought about this one scenario myself and yes
this is quite correct and maybe a bad choosen example from my side. But
we could indent complete TAG's in general e.g.

<?xml version="1.0"?>
<gconf>
 <entry name="accuracy" mtime="14" muser="galaxy" type="string">
  <stringvalue>9</stringvalue>
 </entry>
</gconf>

and this one gives us no sideeffects the Tag's are indented more human
readable and the data is placed between the start and endtag saving us
from having eiter $a, $d or both (e.g. on Windows that adds two bytes
for linebreaks). Isn't this possible ?

> This is what Daniel's first FAQ says and what he is trying to tell
> you.

Yes I saw him writing this stuff but at that time I was more entertained
with the way he wrote the email rather than the informative content I
was really interested in. Besides this it wasn't exactly the point
earlier this day that I was interested in.

But yes your reply makes sense with the whitespaces.

> Havoc

Greets,

Ali Akcaagac




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]