downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

インストール/設定> <SimpleXML
Last updated: Fri, 13 Nov 2009

view this page in

導入

SimpleXML拡張モジュールは、 XMLをオブジェクトにとても簡単かつ容易に変換するための機能を 提供します。変換後のオブジェクトでは、 通常のプロパティセレクタや配列反復子を用いて処理を行うことが 可能です。



add a note add a note User Contributed Notes
導入
SL
24-Mar-2009 11:09
SimpleXML has a beautiful simplicity. The following is one example of how it may be used with namespaces. 

Note, I use the XML that made Paul Reinheimer experience hair loss; for that XML see 

http://blog.preinheimer.com/index.php?/archives/172-SimpleXML,-Namespaces-Hair-loss.html

<?php
$dom
= new DOMDocument();                
$dom->loadXML( $response );               

$ns='urn:ebay:apis:eBLBaseComponents';
$domlist=$dom->getElementsByTagNameNS($ns,'*');  
$sxe=simplexml_import_dom($domlist->item(0)); 
echo
'Ebay Timestamp ',$sxe->Timestamp;  
?>

Running the above code left my own hair uneffected. :)
alvaro at demogracia dot com
30-Sep-2008 08:30
SimpleXML is simple, unless your XML document has namespaces (e.g., tags withs "colons" like <rs:data>). In this case, most code examples in this section will not work at all: namespaces imply that you need to do further processing with functions that are often undocumented.

Look for "namespace" in user notes.

インストール/設定> <SimpleXML
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites