Sep
17
2010
dom_import_simplexml()

dom_import_simplexml

(PHP 5)

dom_import_simplexml --  Gets a DOMElement object from a SimpleXMLElement object

Описание

DOMElement dom_import_simplexml ( SimpleXMLElement node )

This function takes the node node of class SimpleXML and makes it into a DOMElement node. This new object can then be used as a native DOMElement node.

Список параметров

node

The SimpleXMLElement node.

Возвращаемые значения

The DOMElement node added or FALSE if any errors occur.

Примеры

<?php

$sxe 
simplexml_load_string('<books><book><title>blah</title></book></books>');

if (
$sxe === false) {
    echo 
'Error while parsing the document';
    exit;
}

$dom_sxe dom_import_simplexml($sxe);
if (!
$dom_sxe) {
    echo 
'Error while converting XML';
    exit;
}

$dom = new DOMDocument('1.0');
$dom_sxe $dom->importNode($dom_sxetrue);
$dom_sxe $dom->appendChild($dom_sxe);

echo 
$dom->saveXML();

?>

Смотрите также

simplexml_import_dom()

 
 
 
Комментарии
Добавить новый Поиск
Оставить комментарий
Имя:
Email:
 
Веб-сайт:
Тема:
UBB-Код:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Пожалуйста, введите проверочный код, который Вы видите на картинке.
Powered by !JoomlaComment 3.26

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 

Кто онлайн

Сейчас 8 гостей онлайн