[phpXML] two things in _export
Brought to you by:
bs_php,
nigelswinson
|
From: <nig...@us...> - 2001-10-03 22:22:26
|
> Next...mixed content...now, most of you are not going to like the
> solution I have, but here goes anyway...
>
> If the context is mixed, like if the are <br/> in text or something like
> that, the indenting is done, but each time you run the file through and
> save it, the linefeeds keep growing and you end up with this huge gap
> int the xml file. Now, the solution would be to add a paramter to
> export called $useIndent = TRUE and when you called _export recursively,
> just call it with _export(...,!$isMixed) and then when you go to add the
> \n only do it if $useIndent is true...This fixes the <br/> <hr/>
> problem, but if you have more complex stuff, it gets hairy, but in
> reality, mixed content shouldn't be used much...
>
> Tell me what you think!
I recon that the class should only ever add whitespace when appendChild()
and the target node contains no data.
ie inserting a <B/> into the following inserts whitespace marked by []:
==========
<A/>
Goes to
<A>[
]<B/>[
]</A>
==========
<A>
<B/>
</A>
Goes to
<A>
<B/>[
]<B/>
</A>
==========
<A>text</A>
Goes to:
<A>text<B/></A>
==========
Otherwise all whitespace is preserved from the file that was read in.
Would that meet the requirements?
Nigel
--
This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../
|