помогите разобраться c xml

Kirill

Новичок
помогите разобраться c xml

Помогите плиз, а то я совсе запутался. Правильно ли я понимаю, что:
1) для генерации xml с помощью $xml = new DomDoceument() нужно собрать php с параметром with-dom (это типа библиотека?)
2) можно использовать функцию domxml_new_doc, для этого нужны какие-то другие дополнительные библиотеки
3) В нете первый способ называют dom, второй dom xml, как правильно
4) Какой способ лучше использовать, какой будет в будущем поддерживаться, есть ли ещё способы (или формы техже билиотек) генерации xml?
 

Alexandre

PHPПенсионер
В нете первый способ называют dom, второй dom xml, как правильно
Kirillты прав - Истина где-то рядом
Все зависит от версии используемого пхп

-~{}~ 10.11.06 11:26:

The DOM XML extension has been overhauled in PHP 4.3.0 to better comply with the DOM standard. The extension still contains many old functions, but they should no longer be used. In particular, functions that are not object-oriented should be avoided.

The extension allows you to operate on an XML document with the DOM API. It also provides a function domxml_xmltree() to turn the complete XML document into a tree of PHP objects. Currently, this tree should be considered read-only - you can modify it, but this would not make any sense since DomDocument_dump_mem() cannot be applied to it. Therefore, if you want to read an XML file and write a modified version, use DomDocument_create_element(), DomDocument_create_text_node(), set_attribute(), etc. and finally the DomDocument_dump_mem() function.

Note:
This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.0.0.
 
Сверху