How do I open an XML file? How does an XML file open? _WML Tutorial

Source: Internet
Author: User
Tags closing tag xml parser xsl
Extensible Markup Language (extensible Markup Language, XML), which is used to mark an electronic file with a structured markup language that can be used to mark data, define data types, and is a source language that allows users to define their own markup language. XML is a subset of standard Universal Markup Language (SGML) that is ideal for Web transport. XML provides a uniform way to describe and exchange structured data that is independent of applications or vendors.

format attributes

Unlike databases such as access,oracle and SQL Server, the database provides more robust data storage and analysis capabilities, such as data indexing, sorting, lookup, correlation consistency, and so on, and XML is just presenting data. In fact, the biggest difference between XML and other data forms is that he is extremely simple. This is an advantage that looks trivial, but it makes XML unique.

The difference between XML and HTML is that XML is used to store data, and the data itself is the most important. And HTML is used to define the data, and the display mode of the data.
The simplicity of XML makes it easy to read and write data in any application, which makes XML quickly the only common language for data exchange, although different applications support other data interchange formats, but they will soon support XML, which means that the program can be more easily associated with the Windows,mac OS, The combination of Linux and the information generated under other platforms can then easily load XML data into the program and analyze it and output the results in XML format.

To make SGML look user-friendly, XML redefined some of the internal values and parameters of SGML, removing a large number of infrequently used features that make SGML more complicated in designing websites. XML retains SGML's structured functionality, which allows web designers to define their own document types, and XML also introduces a new type of document that allows developers to avoid having to define document types.

Simple syntax

SGML is commonly used to define document type definitions (DTDs) for HTML, and it is often used to write XML DTDs. The problem with SGML is that it allows for some strange syntax, which makes the parser that creates HTML a big challenge:
1 Some start tags do not allow the end tag to appear, such as HTML tags. An error occurs when a closing tag is included.
2 Some start tags can optionally appear as end tags or implicitly end tags
3 Some start tag requirements must appear in the end tag, such as HTML <script> tags.
4 tags can be nested in any order. It is permissible even if the end tag does not appear in reverse order of the start tag, for example, this is a sample string.
5 Some attribute requirements must include values, such as the SRC attribute in the .
6 Some features do not require a value, such as the nowrap attribute in.
7 It is OK to define both sides of the attribute with double quotes, so and are allowed.
These problems make it a daunting task to create a parser for the SGML language. The difficulty of deciding when to apply the above rules has resulted in the definition of SGML language stagnating. With these questions as a starting point, XML is gradually entering our field of vision.
XML removes the arbitrary syntax of SGML, which has previously bothered many developers. In XML, the following syntax is used:
1 Any start tag must have an end tag.
2 You can use another simplified syntax to represent both the start and end tags in a single label. This syntax is followed by a slash (/), such as <tag/>, before the symbol is greater than the sign. The XML parser translates it into <tag></tag>.
3 tags must be nested in the appropriate order, so the closing tag must match the starting tag in the mirror order, such as this is a samplestring. This is like starting and ending labels as the left and right brackets in math: You can't close parentheses without closing all the inner brackets.
4 All attributes must have a value.
5 All attributes must be enclosed with double quotes around the value.
These rules make it much simpler to develop an XML parser and remove the task of parsing SGML to determine when and where to apply those strange grammatical rules. In the first six years after the advent of XML, many different languages were spawned, including MathML, SVG, RDF, RSS, SOAP, XSLT, and XSL-FO, while also improving HTML to XHTML.

Because XML is created by the wide-area business, the standardization of XML is handled by the XML workgroup of the Consortium, which consists of experts from various places and industries who communicate their views on XML standards via email and make their own comments (Www.w3.org/TR/WD-xml). Because XML is a public format (it doesn't belong to any company), you don't have to worry about XML technology as a profitable tool for a handful of companies, and XML is not a language attached to a particular browser.

Open method: With Notepad, EditPlus and other text tool software can be opened, many users to save the configuration file or Web page English, mobile reading site is based on XML development, multi-user Web production related data storage, etc.

Now teach you how to open XML files and software.

Well, the easiest thing to do is to open it with an Excel form.

You can also open an XML document with Netscape 6来, and you can also select "View Source file" with the right mouse button.
When you open an XML document with Netscape 6,
The browser will display the root element and child elements with colored code.

How to open a file in Excel

When you open an XML file in Excel, you are prompted to select one of the following methods to import XML data: As an XML list
As a read-only workbook
Use the XML Source task pane


Open a file as an XML list
When you open an XML source, Excel looks for the markup for the XML style sheet (XSL). XSL describes how data is displayed. If a corresponding tag exists, Excel prompts you to choose whether to apply a style sheet. If you choose to apply XSL, the XSL will indicate how the data is displayed, and in this case the rest of the information in this section of this article will no longer apply.

If you do not have an XSL tag, you receive the following message:


The specified XML source does not have a reference schema. Excel creates the schema based on the XML source data.
Excel then imports the data from the XML source. If the XML data contains duplicate fields within an element, Excel distributes the data across multiple rows. Each row contains a unique dataset. This can cause small datasets in the XML to appear as many rows in Excel.

Open a file as a read-only workbook
If you choose to open the XML source document as a read-only workbook, the first tag of the element is used as the caption and placed in cell A1. The rest of the tags are sorted alphabetically and placed in the second row. When you open the Weather report example in the previous section as a read-only workbook, the data is arranged in the following column header list:/area/city
/area/country
/area/region
/area/state
/date
/measurements/h-index
/measurements/humidity
/measurements/skies
/measurements/temperature
/measurements/uv-index
/measurements isibility
/measurements/wind/direction
/measurements/wind/windspeed
/time
If you have a dataset, the data for each column is placed on the third row of the spreadsheet. If the XML data contains duplicate fields within an element, Excel distributes the data across multiple rows. Each row contains a unique dataset. This can cause small datasets in the XML to appear as many rows in Excel.

Use the XML Source task pane
The schema of the XML data file is displayed in the XML Source task pane. You can then drag the schema elements onto the worksheet to map the elements to the worksheet.

If you open an XML data file that does not refer to a schema, Excel infers the schema of the XML data file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.