XML basic introduction and XML tag element _php tutorial for getting Started with PHP operation XML

Source: Internet
Author: User
Tags getting started with php

XML basic introduction and XML tag elements for getting Started with PHP operation XML


This is explained by an XML instance:

The code is as follows:




Joe
Woman
23


Zhou yu
Man
27


First, the XML declaration:


(1), the XML declaration to be placed in the first line of the document;
(2), Encoding: Document character encoding, such as Utf-8, gb2312, and so on.
(3), standalone: A value of Yes or no, optional, indicates whether the document definition is independent, that is, whether it is associated with other documents. The default is No.

Second, the root element

Wrapped at the outermost layer as the root element, each XML document must have only one root element.

Iii. XML elements/tags/nodes

,,, and so on are elements of XML, which are also known as tags or nodes. Of course, the root element is also an element.
If there is no content in the label, such as there is no entity content , you can abbreviate it. Even if it is written, the browser opens, it is also displayed

Iv. spaces and line breaks in labels

Spaces and line breaks appear in the label, and the XML document treats the spaces and line breaks as the original content. Therefore, you should pay special attention when programming.

V. Naming conventions FOR XML tags

(1) Case-sensitive;
(2) cannot begin with a number or "_";
(3) cannot start with special characters such as XML, XML, XML, etc.;
(4) cannot contain spaces;
(5) cannot contain colons.

http://www.bkjia.com/PHPjc/947792.html www.bkjia.com true http://www.bkjia.com/PHPjc/947792.html techarticle The basic XML Introduction to PHP operation XML and XML tag elements are explained in XML instances: The code is as follows:? xml version=1.0 encoding=utf-8 Standalone=no? Class student name Joe Cole/ Name Sex girl/s ...

  • Related Article

    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.