Home Backend Development XML/RSS Tutorial A brief discussion on reading and editing XML documents

A brief discussion on reading and editing XML documents

Mar 10, 2017 pm 07:20 PM
xml edit read

This article mainly introduces the reading and editing of XML files. The most commonly used tools are of course the console and source code viewing in the browser. Friends in need can refer to

Reader
View the XML document using a simple text editor or any browser. Most major browsers support XML. XML files can be opened in the browser by double-clicking the XML document (if it is a local file) or entering the URL path in the address bar (if the file is located on the server). You can also open other files in the browser in the same way. XML files are saved with the ".xml" extension.

Let's explore the various ways in which you can view XML files. The following example (sample.xml) applies to all chapters in this chapter.


XML/HTML CodeCopy content to clipboard

  1. <?xml version="1.0"?>
    <contact-info>
        <name>Tanmay Patil</name>
        <company>TutorialsPoint</company>
        <phone>(011) 123-4567</phone>
    </contact-info>
    Copy after login

Text Editor
Any simple text editor such as Notepad, Textpad or TextEdit can be used to create or view a XML document, as shown below:
A brief discussion on reading and editing XML documents

FireFox Browser
Double-click the file to open the above XML in FireFox, it will display the highlighted XML code, which makes the code more readable . It also displays a plus (+) and minus (-) sign to the left of the XML element. When we click on the minus sign (-) it hides the code and when we click on the plus sign (+) it expands the code. The output in FireFox will look like this:
A brief discussion on reading and editing XML documents

Chrome Browser
Open the above XML code in Chrome browser. The code is displayed as follows:
A brief discussion on reading and editing XML documents

Errors in the XML document
If some tags are missing in our XML code, the browser will display a information. We can try opening the following XML file in Chrome.


XML/HTML CodeCopy content to clipboard

  1. <?xml version="1.0"?>
    <contact-info>
        <name>Tanmay Patil</name>
        <company>TutorialsPoint</company>
        <phone>(011) 123-4567</phone>
    </ontact-info>
    Copy after login

The opening and closing tags in the above code do not match (i.e. the _contactinfo tag), so the browser will display an error message as follows:
A brief discussion on reading and editing XML documents

We can also find professional online or downloadable XML editors, which have many powerful editing functions, such as:

Automatic closing tags.
Strict grammar checking.
XML syntax color highlighting facilitates readability.
can help us write effective XML code.
Provides the function of automatic verification of XML document DTD and schema.
Open source XML editor
The following provide some open source XML editors:

Xerlin: Xerlin is an open source editor based on the Apache license agreement under the Java 2 platform. It is a Java-based XML modeling application that can easily create and edit XML files.

CAM - Content Assembly Mechanism: CAM editor tool for XML+JSON+SQL Open+XDX sponsored by Oracle.


The above is the detailed content of A brief discussion on reading and editing XML documents. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Can I open an XML file using PowerPoint? Can I open an XML file using PowerPoint? Feb 19, 2024 pm 09:06 PM

Can XML files be opened with PPT? XML, Extensible Markup Language (Extensible Markup Language), is a universal markup language that is widely used in data exchange and data storage. Compared with HTML, XML is more flexible and can define its own tags and data structures, making the storage and exchange of data more convenient and unified. PPT, or PowerPoint, is a software developed by Microsoft for creating presentations. It provides a comprehensive way of

Convert XML data to CSV format in Python Convert XML data to CSV format in Python Aug 11, 2023 pm 07:41 PM

Convert XML data in Python to CSV format XML (ExtensibleMarkupLanguage) is an extensible markup language commonly used for data storage and transmission. CSV (CommaSeparatedValues) is a comma-delimited text file format commonly used for data import and export. When processing data, sometimes it is necessary to convert XML data to CSV format for easy analysis and processing. Python is a powerful

Handling errors and exceptions in XML using Python Handling errors and exceptions in XML using Python Aug 08, 2023 pm 12:25 PM

Handling Errors and Exceptions in XML Using Python XML is a commonly used data format used to store and represent structured data. When we use Python to process XML, sometimes we may encounter some errors and exceptions. In this article, I will introduce how to use Python to handle errors and exceptions in XML, and provide some sample code for reference. Use try-except statement to catch XML parsing errors When we use Python to parse XML, sometimes we may encounter some

How to restore the deleted hosts file How to restore the deleted hosts file Feb 22, 2024 pm 10:48 PM

Title: How to restore the hosts file after deletion Summary: The hosts file is a very important file in the operating system and is used to map domain names to IP addresses. If you accidentally delete the hosts file, you may be unable to access certain websites or have other network problems. This article will introduce how to recover accidentally deleted hosts file in Windows and Mac operating systems. Text: 1. Restore hosts file in Windows operating system. Hosts file in Windows operating system

How to edit documents in Tencent Docs? -Tencent Document Editing Document Tutorial Guide How to edit documents in Tencent Docs? -Tencent Document Editing Document Tutorial Guide Mar 19, 2024 am 08:19 AM

Does anyone know how to edit documents in Tencent Docs? It doesn't matter if you don't know. Today, the editor will introduce detailed graphic explanations on how to edit documents in Tencent Docs. I hope it can help you. Detailed graphic explanation of editing documents in Tencent Documents 1. First, enter Tencent Documents directly (if you don’t have it, download it now!) and log in directly (QQ and TIM two login methods are supported) 2. After logging in, click Add in the upper right corner No., directly create online documents, online forms, new folders, etc.! 3. Then enter the information according to your needs!

Python parsing special characters and escape sequences in XML Python parsing special characters and escape sequences in XML Aug 08, 2023 pm 12:46 PM

Python parses special characters and escape sequences in XML XML (eXtensibleMarkupLanguage) is a commonly used data exchange format used to transfer and store data between different systems. When processing XML files, you often encounter situations that contain special characters and escape sequences, which may cause parsing errors or misinterpretation of the data. Therefore, when parsing XML files using Python, we need to understand how to handle these special characters and escape sequences. 1. Special characters and

What to do if word document cannot be edited What to do if word document cannot be edited Mar 19, 2024 pm 09:37 PM

After editing the document, we will save the document to provide convenience for editing and modifying the document next time. Sometimes we can modify it directly after clicking on the edited document, but sometimes for some unknown reason, there is no response no matter how we click on the word document, and the command will not be executed. , what should I do if the word document cannot be edited? Don’t worry, the editor will help you solve this problem. Let’s take a look at the operation process. After opening a Word document, when editing text, you will see a &quot;Restrict Editing&quot; prompt displayed on the right side of the page, as shown in the figure below. 2. You need to cancel editing and you need to know the set password. Click &quot;Stop Protection&quot; below the pop-up prompt, as shown in the figure below. 3. Then enter the password in the &quot;Unprotect Document&quot; dialog box and click OK, as shown in the figure below.

How to handle XML and JSON data formats in C# development How to handle XML and JSON data formats in C# development Oct 09, 2023 pm 06:15 PM

How to handle XML and JSON data formats in C# development requires specific code examples. In modern software development, XML and JSON are two widely used data formats. XML (Extensible Markup Language) is a markup language used to store and transmit data, while JSON (JavaScript Object Notation) is a lightweight data exchange format. In C# development, we often need to process and operate XML and JSON data. This article will focus on how to use C# to process these two data formats, and attach

See all articles