DOMXML functions in PHP

Source: Internet
Author: User
Sorry, I don't have time to translate. I have to paste DOMXMLfunctionsThesefunctionsareonlyavailableifPHPwasconfiguredwith -- with-dom = [DIR], usingthegnommmllibrary. Youwillne is very embarrassed.

Dom xml functions
These functions are only available if PHP was configured with -- with-dom = [DIR], using the GNOME xml library. you will need at least libxml-2.0.0 (the beta version will not work ). these functions have been added in PHP4.

This module defines the following constants:

Table 1. XML constants

Constant Value Description
XML_ELEMENT_NODE 1
XML_ATTRIBUTE_NODE 2
XML_TEXT_NODE 3
XML_CDATA_SECTION_NODE 4
XML_ENTITY_REF_NODE 5
XML_ENTITY_NODE 6
XML_PI_NODE 7
XML_COMMENT_NODE 8
XML_DOCUMENT_NODE 9
XML_DOCUMENT_TYPE_NODE 10
XML_DOCUMENT_FRAG_NODE 11
XML_NOTATION_NODE 12
XML_GLOBAL_NAMESPACE 1
XML_LOCAL_NAMESPACE 2

This module defines a number of classes. The dom xml functions return a parsed tree of the XML document with each node being an object belonging to one of these classes.

Xmldoc
(PHP4> = 4.0b4)

Xmldoc -- Creates a DOM object of an XML document
Description

Object xmldoc (string str)


The function parses the XML document in str and returns an object of class 'Dom document', having the properties 'Doc' (resource), 'version' (string) and 'type' (long ).

Xmldocfile
(PHP4> = 4.0b4)

Xmldocfile -- Creates a DOM object from XML file
Description

Object xmldocfile (string filename)


The function parses the XML document in the file named filename and returns an object of class 'Dom document', having the properties 'Doc' (resource), 'version' (string ).

Xmltree
(PHP4> = 4.0b4)

Xmltree -- Creates a tree of php objects from XML document
Description

Object xmltree (string str)


The function parses the XML document in str and returns a tree PHP objects as the parsed document.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.