Home Backend Development XML/RSS Tutorial A preliminary understanding of XML basics (pictures and texts)

A preliminary understanding of XML basics (pictures and texts)

Mar 23, 2017 pm 05:00 PM

This article mainly introduces the basic knowledge of XML, from definition, development history to specific applications of XML. Friends in need can refer to the following

XML definition:

A markup language used to mark electronic files to make them structural. It can be used to mark data and define data types. It is a markup language that allows users to define their own markup language. source language.

XML development history?

Briefly mention Markup Language history:

1969: GML (Generalized Markup Language)--(IBMResearch)

1968: SGML (Standard Generalized Markup Language)--(ISO)

1989: HTML (Hypertext Markup Language)--TimBerners Lee

As an instance of SGML, its DTD (a rule) It is fixed as a standard, so Html cannot define the source language of other symbolic languages. And XML is fine, so XML appeared.

1998/2: XML (Extensible markup Language)

W3C(World WideWeb Consortium)

A subset of SGML

XML (definition data and metadata), XSL (style sheet description, just like CSS in html)

SGMLvsXMLvs HTML:

SGML: Store electronic files for a long time.

The usage fee is high, mostly on the MainFrame platform.

XML: Web page file language, data exchange language, data processing language, file integration language.

The scope of application is almost unlimited.

HTML: Web page rendering language, hypertext language.

XML includes:

File content:

Structure definition: DTD (Document TypeDefinitied)

XMLSchema(DTD+Datatype)

Display: XSL

XSLT+XHTML+Xpath+(Xlink)

From html to XML:

## Comparison:

HTML:

html can only provide data display function.

The browser provides a single language mechanism.

Web search is not accurate.

Difficulty in expansion.

Logical relationships between web pages and web page hierarchical authentication are difficult to establish.

Web resources are restricted and cannot be used by other applications.

XML:

Open platform.

Can be used as input data for any program.

XML changes the internal structure of the browser.

XML specific application:

One of the most important applications of XML is as the

configuration file of the system. Many system configuration files are used XML, XML in Spring application, XML in Hibernate, here we mainly talk about XML in ASP.NET.

1. In the configuration file.

All encounters in the world are reunions after a long absence. We have passed by XML countless times, including the configuration files of the computer room charging system, the configuration files of the news release system, and the configuration files we have established for each The configuration file under an application has the suffix name of .config, and our XML file has the suffix of .xml. Why does VS not use Web.xml directly but Web.config? I think it may be because Microsoft wants to Packing something into a confidant is like the same apple in a box. If I want it to be mine, I have to make a package and put my label on it, telling others that this is unique to me. But in fact, there are answers like this on the Internet:

config is the configuration, and .xml is the web page file built into the software.

Appearance:

Former:

Used in web.config or app.config etc.

< ;appSettings> is a node agreed by the system. It is agreed that all nodes under this node will be read by System.Configuration.ConfigurationManager.AppSetting.

Later:

Completely customized contacts, what does appSettings mean, what does add mean, will be specified and used in the xml parsing method written by yourself.

Simply put:

Simply put, config is a subset of xml.

Usually xml only defines basic syntax. As for the node level, node format, node meaning, and how the node is parsed, you can define it yourself. This will make your xml file compatible with your xml parsing method. correspond.

As for web.config, app.config and the like, Microsoft and software authors have already defined the meaning of nodes. You only need to follow its format and rules to achieve the configuration effect.

In layman’s terms:

Let’s use an analogy that may not be a good one:

The xml file itself is a playing card.

config It's Landlords.

When you use config, you don’t need to make your own rules, just follow its rules. It's convenient, but you can't break his rules.

When you write xml yourself, you must first formulate the rules. You can decide the rules as you like, and then play according to these rules.

Of course, there is a major premise for these, and they all meet the xml node specifications. , you can't put a few mahjong tiles into the rules of poker....

2, ASP.NETControl and XML.

When learning ASP.NET videos, I used many controls, such as LIstBox, DropDownList common controls, DataList, GridView and other data controls, ADO.NETDataSet to operate XML files, and the first two blogs The mentioned Navigation controls menu and treeview can bind XML files when binding data sources.

The above is the detailed content of A preliminary understanding of XML basics (pictures and texts). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Can I open an XML file using PowerPoint? Can I open an XML file using PowerPoint? Feb 19, 2024 pm 09:06 PM

Can XML files be opened with PPT? XML, Extensible Markup Language (Extensible Markup Language), is a universal markup language that is widely used in data exchange and data storage. Compared with HTML, XML is more flexible and can define its own tags and data structures, making the storage and exchange of data more convenient and unified. PPT, or PowerPoint, is a software developed by Microsoft for creating presentations. It provides a comprehensive way of

Convert XML data to CSV format in Python Convert XML data to CSV format in Python Aug 11, 2023 pm 07:41 PM

Convert XML data in Python to CSV format XML (ExtensibleMarkupLanguage) is an extensible markup language commonly used for data storage and transmission. CSV (CommaSeparatedValues) is a comma-delimited text file format commonly used for data import and export. When processing data, sometimes it is necessary to convert XML data to CSV format for easy analysis and processing. Python is a powerful

Handling errors and exceptions in XML using Python Handling errors and exceptions in XML using Python Aug 08, 2023 pm 12:25 PM

Handling Errors and Exceptions in XML Using Python XML is a commonly used data format used to store and represent structured data. When we use Python to process XML, sometimes we may encounter some errors and exceptions. In this article, I will introduce how to use Python to handle errors and exceptions in XML, and provide some sample code for reference. Use try-except statement to catch XML parsing errors When we use Python to parse XML, sometimes we may encounter some

Python parsing special characters and escape sequences in XML Python parsing special characters and escape sequences in XML Aug 08, 2023 pm 12:46 PM

Python parses special characters and escape sequences in XML XML (eXtensibleMarkupLanguage) is a commonly used data exchange format used to transfer and store data between different systems. When processing XML files, you often encounter situations that contain special characters and escape sequences, which may cause parsing errors or misinterpretation of the data. Therefore, when parsing XML files using Python, we need to understand how to handle these special characters and escape sequences. 1. Special characters and

How to handle XML and JSON data formats in C# development How to handle XML and JSON data formats in C# development Oct 09, 2023 pm 06:15 PM

How to handle XML and JSON data formats in C# development requires specific code examples. In modern software development, XML and JSON are two widely used data formats. XML (Extensible Markup Language) is a markup language used to store and transmit data, while JSON (JavaScript Object Notation) is a lightweight data exchange format. In C# development, we often need to process and operate XML and JSON data. This article will focus on how to use C# to process these two data formats, and attach

Using Python to implement data verification in XML Using Python to implement data verification in XML Aug 10, 2023 pm 01:37 PM

Using Python to implement data validation in XML Introduction: In real life, we often deal with a variety of data, among which XML (Extensible Markup Language) is a commonly used data format. XML has good readability and scalability, and is widely used in various fields, such as data exchange, configuration files, etc. When processing XML data, we often need to verify the data to ensure the integrity and correctness of the data. This article will introduce how to use Python to implement data verification in XML and give the corresponding

How to use PHP functions to process XML data? How to use PHP functions to process XML data? May 05, 2024 am 09:15 AM

Use PHPXML functions to process XML data: Parse XML data: simplexml_load_file() and simplexml_load_string() load XML files or strings. Access XML data: Use the properties and methods of the SimpleXML object to obtain element names, attribute values, and subelements. Modify XML data: add new elements and attributes using the addChild() and addAttribute() methods. Serialized XML data: The asXML() method converts a SimpleXML object into an XML string. Practical example: parse product feed XML, extract product information, transform and store it into a database.

How Python parses XML files How Python parses XML files Aug 09, 2023 am 11:48 AM

How Python parses XML files XML (eXtensibleMarkupLanguage) is a markup language used to represent structured data. When processing XML data, we often need to parse the XML file to extract the required information. Python provides many libraries and modules to parse XML files, such as ElementTree, lxml, etc. This article will introduce how to use Python to parse XML files, with code examples. In Python,

See all articles