JavaScript's Ajax-3 XML syntax (XML overview, basic syntax)

Source: Internet
Author: User

I. Overview of XML


XML overview

-XML is Extensible Markup Language (extensible Markup Language)

-XML is a markup language, similar to HTML

-XML is designed to transmit data, not real data

-XML tags are not predefined and need to be defined by themselves

-XML is a recommended standard for the consortium


XML use

-XML is applied to many aspects of web development and is often used to simplify the storage and sharing of data

-XML can separate data from HTML

-XML can simplify data sharing

-XML can simplify data transfer


Second, basic grammar


XML declaration

-The XML declaration must start with <?xml and end with?>

-the declaration must start at the 0-row 0-column position of the document

-declaration has only three attributes:

-Version: Specifies the XML document version. Must attribute, because we will not choose 1.1, will only choose 1.0

-Encoding: Specifies the encoding of the current document. Optional attribute, default value is Utf-8

-Standalone: Specifies document independence. The optional attribute, the default value of Yes, indicates that the current document is a stand-alone document. If no indicates that the current document is not a separate document, it depends on the external file


XML syntax

-XML is made up of tags, but all XML elements must have a close tag

-<p>this is a XML target</p>

-<p>this is a XML target (error)

-XML tags are case sensitive and must be written and closed using the same casing

-<Message></Message>

-<message></Message> (Error)

-XML must be nested correctly

-<b><i>this a XML target</i></b>

-<b><i>this a XML targetc</b></i>

-XML must have a root element

-an XML document must have an element that is the parent element of another element

-Attribute values for XML must be quoted


XML element

-XML Element concept

-The XML element refers to the part from (and including) the start tag until (and includes) the end tag

-elements can contain other elements, text, and so on. Element can have properties

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7E/7A/wKioL1cCL4vRzwEIAABca7LVUyE480.png "title=" Web.png "alt=" Wkiol1ccl4vrzweiaabca7lvuye480.png "/>



XML Properties

-XML Properties Overview

-XML elements can include attributes in the start tag, like HTML

-Property provides additional (additional) information about the element, or is used to modify the element

-attribute values must be enclosed in quotation marks, both single and double quotes can be used

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7E/7E/wKiom1cCL8PDFoQOAABqwSkxm-4891.png "title=" Web.png "alt=" Wkiom1ccl8pdfoqoaabqwskxm-4891.png "/>


Summary: This chapter focuses on XML syntax (XML overview, basic syntax)

This article from the "Flying Ants" blog, declined to reprint!

JavaScript's Ajax-3 XML syntax (XML overview, basic syntax)

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.