In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is to share with you about how to use XML. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Getting started with XML 1. What is XML? First, let's look at a piece of code.
XML (Extensible markup language)
] > 0x584A, September 25, 2015 10:24:41 holle,world!-> follow 0x584A and learn XML.. ]] >
Let's take a look at what happens after the browser is running:
1.png
What is the main use of 2.XML?
I believe that students who have been on the Internet for a long time have seen files with the suffix .xml, which is what we call XML files.
As early as after HTML became popular, the W3C disliked the limitations of the HTML language, so it came up with XML in order to replace the HTML language.
Of course, it seems that the W3C's plan has not been successful. (however, ⊙ eggs ⊙)
Although XML did not replace HTML, it continues to this day because of its unique characteristics.
Advantages: 1. Highly customized [label] 2. Data flow specifications in different languages 3. XML is used to describe data. In HTML, the data is written in the HTML tag. 4. XML is designed to describe data: the focus is on what the data is and how to store it. HTML is used to display data: the focus is on how to display the data, and how to better display the data.
In a word, XML:XML is a cross-platform, software-and hardware-independent tool for processing information (a tool for data manipulation and data transmission)
Uh... Let's share a joke with you:
Q: when should I use XML?
A: you can write on your resume that you can XML..
3. Quick start XML
According to the initial code above, let's analyze it step by step.
The first is to declare that the XML version is 1.0 and recognize it using the UTF-8 character set.
The subsequent code is for DTD constraints.
] >
Then someone asked:
What is DTD?
Let's take a look at the W3C explanation:
The document type definition (DTD) defines a legitimate XML document building module. It uses a series of legal elements to define the structure of the document.
Uh... In fact, it's just bullshit. It's the same as not saying it.
All right, stop complaining. In fact, we write XML elements, attributes and other restrictions, the structure we write must follow the DTD constraints.
Let's move on to the following code:
0x584A 10:24:41 on September 25, 2015 holle,world!-> follow 0x584A and learn XML.. ]] >
Did you find anything?
Yes, that's right. It's a tree structure. Let's take a look at the DTD constraint, where the root node class is defined first, and then the person element is defined in the
There are four elements inside the person element: name, time, msg, and data.
Among them, there is a strange thing, we call it CDATA section, only the text in the interval will be ignored by the parser, so it outputs special symbols as is.
Thank you for reading! This is the end of the article on "how to use XML". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.