This article mainly introduces the reading and editing of XML files. The most common tool is the console and source code viewing in the browser, for more information about reading and editing XML files, see this article. The most common tool is the console and source code in the browser. For more information, see
Reader
You can use a simple text editor or any browser to view XML documents. Most mainstream browsers support XML. You can open the XML file in the browser by double-clicking the XML file (if it is a local file) or entering the URL path in the address bar (if the file is on the server, you can also open other files in the browser in the same way. The XML file is saved as a ". xml" extension.
Next, let's explore how to view XML files. The following example (sample. xml) applies to all sections in this chapter.
Copy XML/HTML Code to clipboard
Tanmay Patil
TutorialsPoint
(011) 123-4567
Text editor
Any simple text editor, such as Notepad, Textpad, or TextEdit, can be used to create or view an XML document, as shown below:
FireFox
Double-click the File and open the above XML in FireFox. the highlighted XML code is displayed, which makes the code more readable. It also displays a plus sign (+) and minus sign (-) on the left side of the XML element (-). When we click minus sign (-), the code is hidden and the plus sign (+) times code is displayed. The output in FireFox is as follows:
Chrome
Open the above XML code in Chrome. The code is displayed as follows:
XML document errors
If some labels are missing in our XML code, a message is displayed in the browser. We can try to open the following XML file in Chrome.
Copy XML/HTML Code to clipboard
Tanmay Patil
TutorialsPoint
(011) 123-4567
The start and end tags in the above code do not match (I .e. _ contactinfo tag), so the browser will display an error message, as shown below:
We can also find professional online or downloadable XML editors. they all have many powerful editing functions, such:
Automatically close tags.
Strict syntax check.
XML syntax color highlighting facilitates enhanced readability.
It can help us write effective XML code.
Provides the function of automatically verifying the DTD and mode of the XML document.
Open-source XML editor
The following provides some open-source XML editors:
Xerlin: Xerlin is an open-source editor based on the Apache license protocol on the Java 2 Platform. It is a Java-based XML modeling application that allows you to easily create and edit XML files.
CAM-Content Assembly Mechanism: the CAM editor tool of XML + JSON + SQL Open + XDX is sponsored by Oracle.
The above is the detailed content for reading and editing XML documents. For more information, see other related articles in the first PHP community!