Foreword
XML is becoming more and more popular, and basic tutorials on XML can be found everywhere on the Internet. However, a lot of concepts and terms are often daunting. Many friends asked me: What is the use of XML? Do we need to learn it? I want to write a more comprehensive introduction article based on my personal learning process and experience. First of all, there are two points that need to be affirmed:
First: XML is definitely the future development trend. Whether you are a web designer or a network programmer, you should learn and understand it in time. Waiting will only make you lose opportunities;
Second Two: There will definitely be many new concepts in new knowledge. Only by trying to understand and accept them can you improve. Don't be afraid and run away, after all we are still young.
Outline
This article is divided into five parts. They are XML quick introduction, XML concepts, XML terminology, XML implementation, and XML example analysis. The final appendix introduces XML-related resources. The author stands from the perspective of ordinary web designers and uses plain and vivid language to tell you all aspects of XML, helping you to lift the mystery of XML and quickly enter the new field of XML.
Chapter 1: Quick Start with XML
1. What is XML?
2. Is XML a new concept?
3. What are the benefits of using XML?
4. Is XML difficult to learn?
5. The difference between XML and HTML
6. The strict format of XML
7. More about XML
1. What is XML?
This is often the first question, and you often don’t understand it on the first question, because most textbooks answer this:
XML is the abbreviation of Extensible Markup Language, an extensible markup language. . This is the standard definition. So what is a markup language and why is it called extensibility? It's already a bit confusing. I think it would be better to understand it this way:
You are already very familiar with HTML. It is a markup language. Do you remember its full name: "Hypertext Markup Language". Understood? At the same time, there are many tags in HTML, such as, etc., which are standardized and defined in HTML
4.0, and XML allows you to create such tags yourself, so it is called extensibility.
Here are a few confusing concepts to remind everyone:
1.XML is not a markup language. It is just a metalanguage used to create markup languages (such as HTML). God, I'm confused again! It doesn't matter, you just need to know this: XML and HTML are different, and its uses are much wider than HTML, which we will introduce in detail later.
2.XML is not a replacement for HTML. XML is not an upgrade of HTML, it is just a supplement to HTML, extending more functions to HTML. We will continue to use HTML for a long time to come. (But it is worth noting that XHTML, the upgraded version of HTML, is indeed moving closer to adapting to XML.)
3. You cannot use XML to write web pages directly. Even if it contains XML data, it still needs to be converted into HTML format before it can be displayed on the browser.
The following is an XML sample document (Example 1), used to represent the information of this article:
< ;date>20010115
Note:
1. This code is just code to give you a preliminary understanding of XML, and it cannot What specific applications can be achieved;
2. Statements like , are self-created tags. They are different from HTML tags. For example, here means the title of the article. , in HTML is the page title.
2. Is XML a new concept?
No. XML is derived from SGML, a markup language standard that is earlier than HTML.
Let’s take a brief look at SGML. You only need to have a general idea.
The full name of SGML is "Standard Generalized Markup Language". You can tell just by looking at the name: it is a standard for markup languages, which means that all markup languages are developed in accordance with SGML, including HTML, of course. SGML has a wide coverage. All files with a certain format belong to SGML, such as reports, music scores, etc. HTML is the most common file format of SGML on the Internet. Therefore, people jokingly call SGML the "mother" of HTML.
XML is a simplified version of SGML, except that the complex and uncommon parts are omitted. (Oh, I understand! It is the second "mother" of HTML. No wonder it is more powerful than HTML.) Like SGML, XML can also be applied in various fields such as finance and scientific research. What we are talking about here is just the application of XML in the web. Just the application.
At this point, you should have a little understanding: XML is used to create and define a markup language similar to HTML, and then use this markup language to display information. 3. What are the benefits of using XML?
With HTML, why do we need to use XML?
Because network applications are becoming more and more widespread, it is no longer enough to rely on a single file type of HTML to handle ever-changing documents and data. Moreover, the grammar of HTML itself is very loose, which seriously affects the transmission and sharing of network information. (Think about how many designers’ brain cells have been damaged by browser compatibility issues.) People have already begun to explore ways to meet the needs of various applications on the Internet. It is possible to use SGML, but SGML is too large and complicated to program, so I finally chose the "weight-loss" SGML---XML as the data transmission and interaction tool for next-generation web applications.
What are the benefits of using XML? Let’s look at the description from the w3c organization (XML standard setter):
XML makes using the SGML language on the Internet more "simple and direct": It simplifies the process of defining file types, simplifies the process of programming and processing SGML files, and simplifies the process of defining file types. Delivery and sharing on the Web.
1.XML can be widely used anywhere on the web;
2.XML can meet the needs of network applications;
3. Using XML will make programming easier;
4.XML is easy to learn and create;
5.XML code will be clear and easy to read and understand;
It is still a bit abstract. Let us slowly experience the powerful advantages of XML in the following example tutorials!
4. Is XML difficult to learn?
If you are interested in learning XML, you can’t help but ask: Is XML difficult? What kind of foundation is needed to learn XML?
XML is very simple and easy to learn. If you are familiar with HTML, you will find that its documents are very similar to HTML, look at the same sample document (Example 1):
?xml version="1.0"?>
The first line is an XML declaration, indicating that the document follows the XML version 1.0 specification.
The second line defines the first element (element) in the document, also called the root element: . This is similar to the opening tag in HTML. Note that this name is defined arbitrarily by yourself.
Four sub-elements are defined below: title, author, email, and date. Indicate the title, author, email address and date of the article respectively. Of course, you can define these tags in Chinese, which makes them easier to understand:
This is an XML document. Any netizen who knows HTML can directly write such a simple XML document.
In addition, to learn XML, you must also master a page scripting language, the most common ones are javascript and VB script. Because XML data uses script to implement calling and interaction in HTML. Let’s look at the simplest example (Example 2):
1. Save the following code as myfile.htm
Title:
Author: b>>
Email:
> ;
Date:

如何用PHP和XML实现网站的分页和导航导言:在开发一个网站时,分页和导航功能是很常见的需求。本文将介绍如何使用PHP和XML来实现网站的分页和导航功能。我们会先讨论分页的实现,然后再介绍导航的实现。一、分页的实现准备工作在开始实现分页之前,需要准备一个XML文件,用来存储网站的内容。XML文件的结构如下:<articles><art

一、XML外部实体注入XML外部实体注入漏洞也就是我们常说的XXE漏洞。XML作为一种使用较为广泛的数据传输格式,很多应用程序都包含有处理xml数据的代码,默认情况下,许多过时的或配置不当的XML处理器都会对外部实体进行引用。如果攻击者可以上传XML文档或者在XML文档中添加恶意内容,通过易受攻击的代码、依赖项或集成,就能够攻击包含缺陷的XML处理器。XXE漏洞的出现和开发语言无关,只要是应用程序中对xml数据做了解析,而这些数据又受用户控制,那么应用程序都可能受到XXE攻击。本篇文章以java

当我们处理数据时经常会遇到将XML格式转换为JSON格式的需求。PHP有许多内置函数可以帮助我们执行这个操作。在本文中,我们将讨论将XML格式转换为JSON格式的不同方法。

Pythonxmltodict对xml的操作xmltodict是另一个简易的库,它致力于将XML变得像JSON.下面是一个简单的示例XML文件:elementsmoreelementselementaswell这是第三方包,在处理前先用pip来安装pipinstallxmltodict可以像下面这样访问里面的元素,属性及值:importxmltodictwithopen("test.xml")asfd:#将XML文件装载到dict里面doc=xmltodict.parse(f

使用nmap-converter将nmap扫描结果XML转化为XLS实战1、前言作为网络安全从业人员,有时候需要使用端口扫描利器nmap进行大批量端口扫描,但Nmap的输出结果为.nmap、.xml和.gnmap三种格式,还有夹杂很多不需要的信息,处理起来十分不方便,而将输出结果转换为Excel表格,方面处理后期输出。因此,有技术大牛分享了将nmap报告转换为XLS的Python脚本。2、nmap-converter1)项目地址:https://github.com/mrschyte/nmap-

Scrapy是一款强大的Python爬虫框架,可以帮助我们快速、灵活地获取互联网上的数据。在实际爬取过程中,我们会经常遇到HTML、XML、JSON等各种数据格式。在这篇文章中,我们将介绍如何使用Scrapy分别爬取这三种数据格式的方法。一、爬取HTML数据创建Scrapy项目首先,我们需要创建一个Scrapy项目。打开命令行,输入以下命令:scrapys

xml中node和element的区别是:Element是元素,是一个小范围的定义,是数据的组成部分之一,必须是包含完整信息的结点才是元素;而Node是节点,是相对于TREE数据结构而言的,一个结点不一定是一个元素,一个元素一定是一个结点。

1.在Python中XML文件的编码问题1.Python使用的xml.etree.ElementTree库只支持解析和生成标准的UTF-8格式的编码2.常见GBK或GB2312等中文编码的XML文件,用以在老旧系统中保证XML对中文字符的记录能力3.XML文件开头有标识头,标识头指定了程序处理XML时应该使用的编码4.要修改编码,不仅要修改文件整体的编码,还要将标识头中encoding部分的值修改2.处理PythonXML文件的思路1.读取&解码:使用二进制模式读取XML文件,将文件变为


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
