You are here: Re: [PHP] REQ: DOMDocument needs a way to format XML code « PHP « IT news, forums, messages
Re: [PHP] REQ: DOMDocument needs a way to format XML code

Posted by "Richard Lynch" on 11/14/05 23:07

On Fri, November 11, 2005 2:27 pm, Daevid Vincent wrote:
> I have a feature request (and I'm a bit disappointed that this isn't
> already
> in the DOMDocument, when there are nearly useless methods like
> "normalize()")... Ruby has this built in. xmllint has the --format
> parameter. But yet PHP's DOMDocument has no way of cleaning up the
> code.
>
> Could someone please make a method in PHP v5.x to format the XML.
> After
> adding/deleting nodes, the XML gets fairly messy. Ideally it would
> have an
> offset character position to start the indent (default of 0 or left
> margin),
> and a parameter for how many spaces to use for each indentation
> (default of
> say 4 or 5 (same as a tab)).
>
> You could just make this optional parameters to saveXML(), but I think
> it's
> more flexible to have a DOMDocument->format(offset,spaces);

It might be easy to run your XML through XMLTidy somehow...

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация