xml引入另一个xml文件

A file with the .xml file extension is an Extensible Markup Language (XML) file. These are really just plain text files that use custom tags to describe the structure and other features of the document.

扩展名为.xml的文件是可扩展标记语言(XML)文件。 这些实际上只是纯文本文件,使用自定义标签来描述文档的结构和其他功能。

什么是XML? (What is XML?)

XML is a markup language created by the World Wide Web Consortium (W3C) to define a syntax for encoding documents that both humans and machines could read. It does this through the use of tags that define the structure of the document, as well as how the document should be stored and transported.

XML是由万维网联盟(W3C)创建的一种标记语言,用于定义一种语法,用于对人类和机器均可读取的文档进行编码。 它通过使用定义文档结构的标签以及应如何存储和运输文档来实现此目的。

It’s probably easiest to compare it to another markup language with which you might be familiar—the Hypertext Markup Language (HTML) used to encode web pages. HTML uses a pre-defined set of markup symbols (short codes) that describe the format of content on a web page. For example, the following simple HTML code uses tags to make some words bold and some italic:

将它与您可能熟悉的另一种标记语言(用于编码网页的超文本标记语言(HTML))进行比较可能是最容易的。 HTML使用一组预定义的标记符号(短代码)来描述网页上内容的格式。 例如,以下简单HTML代码使用标记将一些单词加粗和斜体:

This is how you make <b>bold text</b> and this is how you make <i>italic text</i>

The thing that differentiates XML, though, is that it’s extensible. XML doesn’t have a predefined markup language, like HTML does. Instead, XML allows users to create their own markup symbols to describe content, making an unlimited and self-defining symbol set.

但是,区别XML的地方在于它是可扩展的。 XML没有HTML那样的预定义标记语言。 取而代之的是,XML允许用户创建自己的标记符号来描述内容,从而制作出无限制且自定义的符号集。

Essentially, HTML is a language that focuses on the presentation of content, while XML is a dedicated data-description language used to store data.

本质上,HTML是一种专注于内容表示的语言,而XML是一种用于存储数据的专用数据描述语言。

XML is often used as the basis for other document formats—hundreds, in fact. Here are a few you might recognize:

XML通常被用作其他文档格式的基础-实际上有数百种。 您可能会认识以下几个:

  • RSS and ATOM both describe how reader apps handle web feeds.

    RSS和ATOM都描述了阅读器应用如何处理Web feed。

  • Microsoft .NET uses XML for its configuration files.

    Microsoft .NET使用XML作为其配置文件。

  • Microsoft Office 2007 and later use XML as the basis for document structure. That’s what the “X” means in the .DOCX Word document format, for example, and it’s also used in Excel (XLSX files) and PowerPoint (PPTX files).

    Microsoft Office 2007和更高版本使用XML作为文档结构的基础。 例如,这就是.DOCX Word文档格式中“ X”的含义,并且还用于Excel(XLSX文件)和PowerPoint(PPTX文件)中。

So, if you have an XML file, that doesn’t necessarily tell you what app it’s intended for use with. And typically, you won’t need to worry about it, unless you’re the one actually designing the XML files.

因此,如果您有一个XML文件,则不一定告诉您打算使用哪个应用程序。 通常,您无需担心,除非您是真正设计XML文件的人。

我如何打开一个? (How Do I Open One?)

There are a few ways you can open an XML file directly. You can open and edit them with any text editor, view them with any web browser, or use a website that lets you view, edit, and even convert them to other formats.

您可以通过几种方法直接打开XML文件。 您可以使用任何文本编辑器打开和编辑它们,使用任何Web浏览器查看它们,或者使用可以查看,编辑甚至将它们转换为其他格式的网站。

如果您定期使用XML文件,请使用文本编辑器 (Use a Text Editor If You Work With XML Files Regularly)

Since XML files are really just text files, you can open them in any text editor. The thing is, a lot of text editors—like Notepad—just aren’t designed to show XML files with their proper structure. It might be okay for popping an XML file open and taking a quick look to help figure out what it is. But, there are much better tools for working with them.

由于XML文件实际上只是文本文件,因此您可以在任何文本编辑器中打开它们。 事实是,许多文本编辑器(如记事本)并不是为了显示具有适当结构的XML文件而设计的。 弹出一个XML文件并快速浏览一下以找出其含义可能是好的。 但是,还有很多更好的工具可以与他们合作。

Right-click the XML file you want to open, point to “Open With” on the context menu, and then click the “Notepad” option.

用鼠标右键单击要打开的XML文件,在上下文菜单上指向“打开方式”,然后单击“记事本”选项。

Note: We’re using Windows examples here, but the same holds true for other operating systems. Look for a good third-party text editor that is designed to support XML files.

注意:此处使用的是Windows示例,但其他操作系统也是如此。 寻找一个好的第三方文本编辑器,该编辑器旨在支持XML文件。

The file does open, but as you can see, it loses most of its formatting and crams the whole thing onto just two lines of the document.

该文件确实打开了,但是如您所见,它丢失了大部分格式,并将整个内容塞满了文档的两行。

So while Notepad might be useful for quickly checking out an XML file, you’re much better off with a more advanced tool like Notepad++, which highlights syntax and formats the file the way it’s intended.

因此,虽然Notepad可能对于快速检出XML文件很有用,但是使用更先进的工具(例如Notepad ++)会更好,它可以突出显示语法并按预期方式格式化文件。

Here is the same XML file opened in Notepad++:

这是在Notepad ++中打开的相同XML文件:

使用Web浏览器查看结构化数据 (Use a Web Browser to View the Structured Data)

If don’t really need to edit XML files, but just need to view them on occasion, the browser you’re using to read this article is well-suited to the job. And in fact, your default web browser is likely set up as the default viewer for XML files. So, double-clicking an XML file should open it in your browser.

如果确实不需要编辑XML文件,而只是偶尔需要查看它们,那么您用来阅读本文的浏览器非常适合此工作。 实际上,您的默认Web浏览器可能已设置为XML文件的默认查看器。 因此,双击XML文件应在浏览器中将其打开。

If not, you can right-click the file to find options for opening it with whatever app you want. Just select your web browser from the list of programs. We’re using Chrome in this example.

如果没有,您可以右键单击该文件以找到用于使用所需任何应用程序打开文件的选项。 只需从程序列表中选择您的Web浏览器。 在此示例中,我们使用的是Chrome。

When the file opens, you should see nicely-structured data. It’s not as pretty as the color-coded view you get with something like Notepad++, but it’s a far sight better than what you get with Notepad.

打开文件后,您应该会看到结构良好的数据。 它不如使用Notepad ++所获得的带有颜色编码的视图漂亮,但远比使用Notepad所获得的更好。

使用在线编辑器查看,编辑或转换XML文件 (Use An Online Editor to View, Edit, or Convert XML Files)

If want to edit the occasional XML file and don’t want to download a new text editor, or if you need to convert an XML file to another format, there are a few decent online XML editors available for free. TutorialsPoint.com, XMLGrid.net, and CodeBeautify.org all let you view and edit XML files. After you’ve done your editing, you can download the changed XML file, or even convert it to a different format.

如果要编辑偶发的XML文件并且不想下载新的文本编辑器,或者需要将XML文件转换为另一种格式,则有一些不错的在线XML编辑器免费提供。 TutorialsPoint.com , XMLGrid.net和CodeBeautify.org均允许您查看和编辑XML文件。 完成编辑后,您可以下载更改后的XML文件,甚至可以将其转换为其他格式。

For the example here, we’ll be using CodeBeautify.org. The page is divided into three sections. On the left is the XML file you’re working with. In the middle, you’ll find several options. On the right, you’ll see the results of some of the options you can select. For example, in the image below, our full XML file is on the left and the tree view is showing in the results pane because we clicked the “Tree View” button in the middle.

对于此处的示例,我们将使用CodeBeautify.org。 该页面分为三个部分。 左侧是您正在使用的XML文件。 在中间,您会找到几个选项。 在右侧,您将看到可以选择的某些选项的结果。 例如,在下图中,我们的完整XML文件位于左侧,并且树状视图显示在结果窗格中,因为我们单击了中间的“树状视图”按钮。

Here’s a better look at those options. Use the “Browse” button to upload an XML file from your computer or the “Load URL” button to pull XML from an online source.

这是对这些选项的更好看。 使用“浏览”按钮从计算机上载XML文件,或使用“加载URL”按钮从在线资源中提取XML。

The “Tree View” button displays your data in a nicely formatted tree structure in the results pane, with all your tags on the left in orange and the attributes to the right of the tags.

“树状视图”按钮在结果窗格中以格式正确的树结构显示数据,所有标签的左侧为橙色,标签的右侧为属性。

The “Beautify” displays your data in neat, easy-to-read lines in the results pane.

“美化”在结果窗格中以整洁,易于阅读的行显示您的数据。

The “Minify” button displays your data using the least amount of white space possible. It will attempt to put every single piece of data on one line. This comes in handy when trying to make the file smaller. It will save some space, but at the cost of being able to read it effectively.

“缩小”按钮使用尽可能少的空白显示您的数据。 它将尝试将每条数据放在一行上。 尝试使文件更小时,这很有用。 它将节省一些空间,但要以能够有效读取它为代价。

And finally, you can use the “XML to JSON” button to convert the XML to JSON format, the “Export to CSV” button to save your data as a comma-separated values file, or the “Download” button to download any changes you’ve made as a new XML file.

最后,您可以使用“将XML转换为JSON”按钮将XML转换为JSON格式,使用“导出为CSV”按钮将数据另存为逗号分隔的值文件,或使用“下载”按钮下载任何更改您已将其制作为新的XML文件。

翻译自: https://www.howtogeek.com/357092/what-is-an-xml-file-and-how-do-i-open-one/

xml引入另一个xml文件

xml引入另一个xml文件_什么是XML文件(以及如何打开一个XML文件)?相关推荐

  1. python打开文件_用Python(in PsychoPy)打开SPSS数据文件

    用Python(in PsychoPy)打开SPSS数据文件 有时,要访问SPSS的sav文件中的内容,而手里电脑没有SPSS软件,或者需要对SPSS数据文件中的数据进行SPSS支持不够好的操作,如对 ...

  2. python写入一个文件之前可以不打开_如何用python实现真正的打开和关闭文件

    file_name:file_name变量是一个包含了你要访问的文件名称的字符串值. access_mode:access_mode决定了打开文件的模式:只读,写入,追加等.所有可取值见如下的完全列表 ...

  3. win10无法装载iso文件_Win10如何使用自带虚拟光驱打开ISO镜像文件?

    Win10如何使用自带虚拟光驱打开ISO镜像文件?ISO文件也就是光盘镜像文件,我们可以在光盘上安装虚拟光驱软件来挂载打开ISO镜像文件,也可以利用解压缩软件来打开ISO镜像文件,而在Win10系统我 ...

  4. Ubuntu文件写入内容时出现错误 E121:无法打开并写入文件解决方案

    Ubuntu文件写入内容时出现错误 E121:无法打开并写入文件解决方案 参考文章: (1)Ubuntu文件写入内容时出现错误 E121:无法打开并写入文件解决方案 (2)https://www.cn ...

  5. 8s nfs 挂载文件_把你的树莓派家庭实验室变成一个网络文件系统 | Linux 中国

    导读:使用 NFS 服务器将共享文件系统添加到你的家庭实验室. 本文字数:8554,阅读时长大约:12分钟https://linux.cn/article-12413-1.html作者:Chris C ...

  6. access vba打开excel文件_除了VBA,还有哪些编程语言可以操作Excel文件?

    Excel(Microsoft office)是现在最常用的办公软件,主要涉及电子表格制作.数据处理.报表输出展示以及更高端的还有金融建模等:我们知道,在需要批处理多个Excel工作表以及工作簿的时候 ...

  7. nginx不同server不同日志文件_招标里的答疑是什么?和澄清文件有何不同?

    招标过程中,由于招投标文件的失误,经常会需要澄清文件,那么招标里的答疑又是什么?和澄清文件是否一样?今天保标招标小编就来重点研究一下这个问题. 招标里的答疑是什么? 答疑应该是指是投标人购买招标文件后 ...

  8. opengl 深度详解_一步步学OpenGL(1) -《打开一个窗口》

    注意本教程中需要使用的是freeGLUT(GLUT太老会有潜在危险)窗口库和GLEW扩展库. vs2013配置freeGLUT3.0:vs2013 配置 freeglut3.0(opengl的窗口系统 ...

  9. xftp如何搜索文件_头条搜索站长平台如何添加网站和sitemap文件?附图文教程

    头条搜索站长平台已经上线了,目前我们广大站长都可以登录该平台后添加新网站和提交 sitemap 地图文件,建议大家可以前往尝试一下,多一个搜索平台就多一条路,认为倒是挺好的.下面就跟大家简单介绍头条搜 ...

  10. 转储sql文件_在Linux上SQL Server中更改SQL转储文件位置

    转储sql文件 In this article, we will talk about SQL Dump files and the process to change the dump direct ...

最新文章

  1. LVM逻辑卷轴管理和磁盘配额实验
  2. 定义派生类拷贝构造函数
  3. 如何替换所有出现的字符串?
  4. linux下的rman自动备份脚本,LINUX上RMAN自动备份脚本
  5. win10+vs2017 snmp开发实例
  6. 如何隐藏storyboard中的top bar
  7. Intel 64/x86_64/IA-32/x86处理器 - 指令格式(6) - 8086/16位指令位移量字节/立即数字节
  8. powerbi如何创建参数_创建PowerBI「参数」轻松搞定动态分析
  9. c# 如何抓微信把柄_抓住把柄表情包 - 抓住把柄微信表情包 - 抓住把柄QQ表情包 - 发表情 fabiaoqing.com...
  10. javascript高级编程笔记04(基本概念)
  11. 关于计算机知识的动画电影,动画概论总复习题目(附答案)
  12. python实现图片压缩_python如何实现图片压缩
  13. 【论文】如何记论文笔记
  14. android仿微信发送位置,Android仿微信发送位置-百度地图
  15. Ubuntu18.04通过apt安装libssl1.1因依赖问题导致失败的解决办法
  16. pjsip 设置麦克风语音输入量 扬声器播放
  17. 大数据杀熟对哪些人有害?
  18. var和let和const_用故事讲解JavaScript的var,let和const变量
  19. 百度统计代码怎么开通,百度统计代码如何获取?怎么在网站上添加百度统计代码?
  20. css实现实心三角形、有边框的三角形和空心三角形

热门文章

  1. 海南大学 838信号与系统专业课的感悟
  2. 张同须全面介绍中国移动5G+AI新基建布局(附PPT)
  3. R语言重复测量方差分析
  4. java 防止恶意刷新_防止恶意刷新接口, 控制在5秒内不能被刷新10次以上
  5. IDEA文件出现java file out of source root解决方法
  6. 等额本息、等额本金、等本等息概念
  7. kubernetes 是一个分布式的集群管理系统
  8. 世界500强公司要求员工必须熟练掌握的七种工作方法
  9. 如何在Win10(包括2004版本)下安装64位CATIA
  10. 2022漂亮有质感的SummerAdmin后台模板+Layui内核