Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 12266

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>SimpleXML functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="函数参考"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="shmop_write"
HREF="function.shmop-write.html"><LINK
REL="NEXT"
TITLE="SimpleXMLElement->addAttribute()"
HREF="function.simplexml-element-addattribute.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="reference"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.shmop-write.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.simplexml-element-addattribute.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.simplexml"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>CLI. SimpleXML functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN209232"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="simplexml.intro"
>简介</A
></H1
><P
>&#13;     The SimpleXML extension provides a very simple and easily usable
     toolset to convert XML to an object that can be processed with
     normal property selectors and array iterators.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="simplexml.requirements"
>需求</A
></H1
><P
>&#13;     The SimpleXML extension requires PHP 5.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="simplexml.installation"
>安装</A
></H1
><P
>&#13;  The SimpleXML extension is enabled by default.  To disable it, use the
  <CODE
CLASS="option"
>--disable-simplexml</CODE
> configure option.
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="simplexml.examples"
>范例</A
></H1
><P
>&#13;     Many examples in this reference require an XML string. Instead of
     repeating this string in every example, we put it into a file which
     we include in each example. This included file is shown in the 
     following example section. Alternatively, you could create an XML
     document and read it with <A
HREF="function.simplexml-load-file.html"
><B
CLASS="function"
>simplexml_load_file()</B
></A
>.
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209248"
></A
><P
><B
>例 1. Include file example.php with XML string</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />$xmlstr </font><font color="#007700">= &lt;&lt;&lt;XML<br /></font><font color="#0000BB">&lt;?xml version='1.0' standalone='yes'?&gt;<br />&lt;movies&gt;<br /> &lt;movie&gt;<br />&nbsp;&nbsp;&lt;title&gt;PHP: Behind the Parser&lt;/title&gt;<br />&nbsp;&nbsp;&lt;characters&gt;<br />&nbsp;&nbsp;&nbsp;&lt;character&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;Ms. Coder&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;actor&gt;Onlivia Actora&lt;/actor&gt;<br />&nbsp;&nbsp;&nbsp;&lt;/character&gt;<br />&nbsp;&nbsp;&nbsp;&lt;character&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;Mr. Coder&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;actor&gt;El Act&amp;#211;r&lt;/actor&gt;<br />&nbsp;&nbsp;&nbsp;&lt;/character&gt;<br />&nbsp;&nbsp;&lt;/characters&gt;<br />&nbsp;&nbsp;&lt;plot&gt;<br />&nbsp;&nbsp;&nbsp;So, this language. It's like, a programming language. Or is it a<br />&nbsp;&nbsp;&nbsp;scripting language? All is revealed in this thrilling horror spoof<br />&nbsp;&nbsp;&nbsp;of a documentary.<br />&nbsp;&nbsp;&lt;/plot&gt;<br />&nbsp;&nbsp;&lt;rating type="thumbs"&gt;7&lt;/rating&gt;<br />&nbsp;&nbsp;&lt;rating type="stars"&gt;5&lt;/rating&gt;<br /> &lt;/movie&gt;<br />&lt;/movies&gt;<br /></font><font color="#007700">XML;<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     The simplicity of SimpleXML appears most clearly when one extracts
     a string or number from a basic XML document.
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209252"
></A
><P
><B
>例 2. Getting <TT
CLASS="literal"
>&#60;plot&#62;</TT
></B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#007700">include </font><font color="#DD0000">'example.php'</font><font color="#007700">;<br /><br /></font><font color="#0000BB">$xml </font><font color="#007700">= new </font><font color="#0000BB">SimpleXMLElement</font><font color="#007700">(</font><font color="#0000BB">$xmlstr</font><font color="#007700">);<br /><br />echo </font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]-&gt;</font><font color="#0000BB">plot</font><font color="#007700">; </font><font color="#FF8000">// "So this language. It's like..."<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209257"
></A
><P
><B
>例 3. Accessing non-unique elements in SimpleXML</B
></P
><P
>&#13;       When multiple instances of an element exist as children of
       a single parent element, normal iteration techniques apply.
      </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#007700">include </font><font color="#DD0000">'example.php'</font><font color="#007700">;<br /><br /></font><font color="#0000BB">$xml </font><font color="#007700">= new </font><font color="#0000BB">SimpleXMLElement</font><font color="#007700">(</font><font color="#0000BB">$xmlstr</font><font color="#007700">);<br /><br /></font><font color="#FF8000">/* For each &lt;movie&gt; node, we echo a separate &lt;plot&gt;. */<br /></font><font color="#007700">foreach (</font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie </font><font color="#007700">as </font><font color="#0000BB">$movie</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$movie</font><font color="#007700">-&gt;</font><font color="#0000BB">plot</font><font color="#007700">, </font><font color="#DD0000">'&lt;br /&gt;'</font><font color="#007700">;<br />}<br /><br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209262"
></A
><P
><B
>例 4. Using attributes</B
></P
><P
>&#13;       So far, we have only covered the work of reading element names
       and their values. SimpleXML can also access element attributes.
       Access attributes of an element just as you would elements
       of an <A
HREF="language.types.array.html"
><B
CLASS="type"
>array</B
></A
>.
      </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#007700">include </font><font color="#DD0000">'example.php'</font><font color="#007700">;<br /><br /></font><font color="#0000BB">$xml </font><font color="#007700">= new </font><font color="#0000BB">SimpleXMLElement</font><font color="#007700">(</font><font color="#0000BB">$xmlstr</font><font color="#007700">);<br /><br /></font><font color="#FF8000">/* Access the &lt;rating&gt; nodes of the first movie.<br /> * Output the rating scale, too. */<br /></font><font color="#007700">foreach (</font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]-&gt;</font><font color="#0000BB">rating </font><font color="#007700">as </font><font color="#0000BB">$rating</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;switch((string) </font><font color="#0000BB">$rating</font><font color="#007700">[</font><font color="#DD0000">'type'</font><font color="#007700">]) { </font><font color="#FF8000">// Get attributes as element indices<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">case </font><font color="#DD0000">'thumbs'</font><font color="#007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$rating</font><font color="#007700">, </font><font color="#DD0000">' thumbs up'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;case </font><font color="#DD0000">'stars'</font><font color="#007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$rating</font><font color="#007700">, </font><font color="#DD0000">' stars'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209268"
></A
><P
><B
>例 5. Comparing Elements and Attributes with Text</B
></P
><P
>&#13;       To compare an element or attribute with a string or pass it into a 
       function that requires a string, you must cast it to a string using 
       <TT
CLASS="literal"
>(string)</TT
>. Otherwise, PHP treats the element as an object.
      </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php &nbsp;&nbsp;&nbsp;&nbsp;<br /></font><font color="#007700">include </font><font color="#DD0000">'example.php'</font><font color="#007700">;<br /><br /></font><font color="#0000BB">$xml </font><font color="#007700">= new </font><font color="#0000BB">SimpleXMLElement</font><font color="#007700">(</font><font color="#0000BB">$xmlstr</font><font color="#007700">);<br /><br />if ((string) </font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie</font><font color="#007700">-&gt;</font><font color="#0000BB">title </font><font color="#007700">== </font><font color="#DD0000">'PHP: Behind the Parser'</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;print </font><font color="#DD0000">'My favorite movie.'</font><font color="#007700">;<br />}<br /><br /></font><font color="#0000BB">htmlentities</font><font color="#007700">((string) </font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie</font><font color="#007700">-&gt;</font><font color="#0000BB">title</font><font color="#007700">);<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209274"
></A
><P
><B
>例 6. Using XPath</B
></P
><P
>&#13;       SimpleXML includes built-in <ACRONYM
CLASS="acronym"
>XPath</ACRONYM
> support.
       To find all <TT
CLASS="literal"
>&#60;character&#62;</TT
> elements:
      </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#007700">include </font><font color="#DD0000">'example.php'</font><font color="#007700">;<br /></font><font color="#0000BB">$xml </font><font color="#007700">= new </font><font color="#0000BB">SimpleXMLElement</font><font color="#007700">(</font><font color="#0000BB">$xmlstr</font><font color="#007700">);<br /><br />foreach (</font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">xpath</font><font color="#007700">(</font><font color="#DD0000">'//character'</font><font color="#007700">) as </font><font color="#0000BB">$character</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#0000BB">$character</font><font color="#007700">-&gt;</font><font color="#0000BB">name</font><font color="#007700">, </font><font color="#DD0000">'played by '</font><font color="#007700">, </font><font color="#0000BB">$character</font><font color="#007700">-&gt;</font><font color="#0000BB">actor</font><font color="#007700">, </font><font color="#DD0000">'&lt;br /&gt;'</font><font color="#007700">;<br />}<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
><P
>&#13;       '<TT
CLASS="literal"
>//</TT
>' serves as a wildcard. To specify absolute
       paths, omit one of the slashes.
      </P
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209283"
></A
><P
><B
>例 7. Setting values</B
></P
><P
>&#13;       Data in SimpleXML doesn't have to be constant. The object allows
       for manipulation of all of its elements.
      </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#007700">include </font><font color="#DD0000">'example.php'</font><font color="#007700">;<br /></font><font color="#0000BB">$xml </font><font color="#007700">= new </font><font color="#0000BB">SimpleXMLElement</font><font color="#007700">(</font><font color="#0000BB">$xmlstr</font><font color="#007700">);<br /><br /></font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]-&gt;</font><font color="#0000BB">characters</font><font color="#007700">-&gt;</font><font color="#0000BB">character</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]-&gt;</font><font color="#0000BB">name </font><font color="#007700">= </font><font color="#DD0000">'Miss Coder'</font><font color="#007700">;<br /><br />echo </font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">asXML</font><font color="#007700">();<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
><P
>&#13;       The above code will output a new XML document, just like the original,
       except that the new XML will change Ms. Coder to Miss Coder.
      </P
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209289"
></A
><P
><B
>例 8. Adding elements and attributes</B
></P
><P
>&#13;       Since PHP 5.1.3, SimpleXML has had the ability to easily add children and
       attributes.
      </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#007700">include </font><font color="#DD0000">'example.php'</font><font color="#007700">;<br /></font><font color="#0000BB">$xml </font><font color="#007700">= new </font><font color="#0000BB">SimpleXMLElement</font><font color="#007700">(</font><font color="#0000BB">$xmlstr</font><font color="#007700">);<br /><br /></font><font color="#0000BB">$character </font><font color="#007700">= </font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]-&gt;</font><font color="#0000BB">characters</font><font color="#007700">-&gt;</font><font color="#0000BB">addChild</font><font color="#007700">(</font><font color="#DD0000">'character'</font><font color="#007700">);<br /></font><font color="#0000BB">$character</font><font color="#007700">-&gt;</font><font color="#0000BB">addChild</font><font color="#007700">(</font><font color="#DD0000">'name'</font><font color="#007700">, </font><font color="#DD0000">'Mr. Parser'</font><font color="#007700">);<br /></font><font color="#0000BB">$character</font><font color="#007700">-&gt;</font><font color="#0000BB">addChild</font><font color="#007700">(</font><font color="#DD0000">'actor'</font><font color="#007700">, </font><font color="#DD0000">'John Doe'</font><font color="#007700">);<br /><br /></font><font color="#0000BB">$rating </font><font color="#007700">= </font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">movie</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]-&gt;</font><font color="#0000BB">addChild</font><font color="#007700">(</font><font color="#DD0000">'rating'</font><font color="#007700">, </font><font color="#DD0000">'PG'</font><font color="#007700">);<br /></font><font color="#0000BB">$rating</font><font color="#007700">-&gt;</font><font color="#0000BB">addAttribute</font><font color="#007700">(</font><font color="#DD0000">'type'</font><font color="#007700">, </font><font color="#DD0000">'mpaa'</font><font color="#007700">);<br /><br />echo </font><font color="#0000BB">$xml</font><font color="#007700">-&gt;</font><font color="#0000BB">asXML</font><font color="#007700">();<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
><P
>&#13;       The above code will output an XML document based on the original but 
       having a new character and rating.
      </P
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN209295"
></A
><P
><B
>例 9. DOM Interoperability</B
></P
><P
>&#13;       PHP has a mechanism to convert XML nodes between SimpleXML
       and DOM formats. This example shows how one might change
       a DOM element to SimpleXML.
      </P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />$dom </font><font color="#007700">= new </font><font color="#0000BB">domDocument</font><font color="#007700">;<br /></font><font color="#0000BB">$dom</font><font color="#007700">-&gt;</font><font color="#0000BB">loadXML</font><font color="#007700">(</font><font color="#DD0000">'&lt;books&gt;&lt;book&gt;&lt;title&gt;blah&lt;/title&gt;&lt;/book&gt;&lt;/books&gt;'</font><font color="#007700">);<br />if (!</font><font color="#0000BB">$dom</font><font color="#007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </font><font color="#DD0000">'Error while parsing the document'</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<br />}<br /><br /></font><font color="#0000BB">$s </font><font color="#007700">= </font><font color="#0000BB">simplexml_import_dom</font><font color="#007700">(</font><font color="#0000BB">$dom</font><font color="#007700">);<br /><br />echo </font><font color="#0000BB">$s</font><font color="#007700">-&gt;</font><font color="#0000BB">book</font><font color="#007700">[</font><font color="#0000BB">0</font><font color="#007700">]-&gt;</font><font color="#0000BB">title</font><font color="#007700">;<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>目录</B
></DT
><DT
><A
HREF="function.simplexml-element-addattribute.html"
>SimpleXMLElement-&#62;addAttribute()</A
>&nbsp;--&nbsp;
   Adds an attribute to the SimpleXML element
  </DT
><DT
><A
HREF="function.simplexml-element-addchild.html"
>SimpleXMLElement-&#62;addChild()</A
>&nbsp;--&nbsp;
   Adds a child element to the XML node
  </DT
><DT
><A
HREF="function.simplexml-element-asxml.html"
>SimpleXMLElement-&#62;asXML()</A
>&nbsp;--&nbsp;
   Return a well-formed XML string based on SimpleXML element
  </DT
><DT
><A
HREF="function.simplexml-element-attributes.html"
>SimpleXMLElement-&#62;attributes()</A
>&nbsp;--&nbsp;Identifies an element's attributes</DT
><DT
><A
HREF="function.simplexml-element-children.html"
>SimpleXMLElement-&#62;children()</A
>&nbsp;--&nbsp;Finds children of given node</DT
><DT
><A
HREF="function.simplexml-element-construct.html"
>SimpleXMLElement-&#62;__construct()</A
>&nbsp;--&nbsp;
   Creates a new SimpleXMLElement object
  </DT
><DT
><A
HREF="function.simplexml-element-getdocnamespaces.html"
>SimpleXMLElement-&#62;getDocNamespaces()</A
>&nbsp;--&nbsp;
   Returns namespaces declared in document
  </DT
><DT
><A
HREF="function.simplexml-element-getname.html"
>SimpleXMLElement-&#62;getName()</A
>&nbsp;--&nbsp;Gets the name of the XML element</DT
><DT
><A
HREF="function.simplexml-element-getnamespaces.html"
>SimpleXMLElement-&#62;getNamespaces()</A
>&nbsp;--&nbsp;
   Returns namespaces used in document
  </DT
><DT
><A
HREF="function.simplexml-element-registerxpathnamespace.html"
>SimpleXMLElement-&#62;registerXPathNamespace()</A
>&nbsp;--&nbsp;
   Creates a prefix/ns context for the next XPath query
  </DT
><DT
><A
HREF="function.simplexml-element-xpath.html"
>SimpleXMLElement-&#62;xpath()</A
>&nbsp;--&nbsp;Runs XPath query on XML data</DT
><DT
><A
HREF="function.simplexml-import-dom.html"
>simplexml_import_dom</A
>&nbsp;--&nbsp;Get a <TT
CLASS="literal"
>SimpleXMLElement</TT
> object from a DOM node.</DT
><DT
><A
HREF="function.simplexml-load-file.html"
>simplexml_load_file</A
>&nbsp;--&nbsp;
   Interprets an XML file into an object
  </DT
><DT
><A
HREF="function.simplexml-load-string.html"
>simplexml_load_string</A
>&nbsp;--&nbsp;
   Interprets a string of XML into an object
  </DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.shmop-write.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.simplexml-element-addattribute.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>shmop_write</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SimpleXMLElement-&#62;addAttribute()</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>