Home >Backend Development >XML/RSS Tutorial >A preliminary understanding of XML basics (pictures and texts)
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 theconfiguration 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 allSimply 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!