Introduction to reading and editing XML documents

Source: Internet
Author: User
Tags tutorialspoint
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

  1.    
           
        
         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

  1.    
           
        
         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!

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.