Using Google Chrome as an XML Syntax Checker

This section provides a tutorial example on how to use Google Chrome as an XML file syntax checker. If there are syntax errors in an XML file, Chrome will stop displaying the XML file at the first error location.

Google Chrome can also be used as an XML syntax checker.

Look at the following XML file, incorrect.xml

<?xml version="1.0"?>
<!-- incorrect.xml
 - Copyright (c) 1999-2014 HerongYang.com. All Rights Reserved.
-->
<dictionary>
 <word>
  <update date="2014-12-23"/>
  <name is_acronym="true">XML</Name>
  <description>eXtensible Markup Language</description>
 </word>
 <word>
  <update date="2014-12-23"/>
  <name is_acronym="true">POP</name>
  <definition default>Post Office Protocol</definition>
  <definition>Point Of Purchase</definition>
</dictionary>

Do you know how many syntax errors are in this XML file?

If you open incorrect.xml with Chrome, you will see the following:

This page contains the following errors:

error on line 8 at column 30: Opening and ending tag mismatch:
name line 0 and Name

Below is a rendering of the page up to the first error.

This is almost perfect.

Exercise: Fix all the syntax errors in incorrect.xml.

The following picture shows you how Google Chrome detects and displays XML syntax errors:

XML Syntax Error Showing in Chrome
XML Syntax Error Showing in Chrome

Table of Contents

 About This Book

 Introduction of XML (eXtensible Markup Language)

 XML File Syntax

XML File Browsers

 Using Google Chrome as an XML Browser

Using Google Chrome as an XML Syntax Checker

 Using Mozilla Firefox as an XML Browser

 Using Mozilla Firefox as an XML Syntax Checker

 Using Apple Safari as an XML Browser

 Using Apple Safari as an XML Syntax Checker

 Using Microsoft Edge as an XML Browser

 Using Microsoft Edge as an XML Syntax Checker

 Using Internet Explorer as an XML Browser

 Using Internet Explorer as an XML Syntax Checker

 XML Spy and Other XML Browsers

 XML-JSON Document Conversion

 DOM (Document Object Model) Programming Interface

 SAX (Simple API for XML) Programming Interface

 DTD (Document Type Definition) Introduction

 Syntaxes of DTD Statements

 Validating an XML Document against the Specified DTD Document Type

 XSD (XML Schema Definition) Introduction

 Syntaxes of XSD Statements

 Validating XML Documents Against Specified XML Schemas

 XSL (Extensible Stylesheet Language) Introduction

 Java Implementation of XSLT

 XSLT (XSL Transformations) Introduction

 XPath (XML Path) Language

 XSLT Elements as Programming Statements

 Control and Generate XML Element in the Result

 PHP Extensions for XML Manipulation

 Processing XML with Python Scripts

 XML Notepad - XML Editor

 XML Tools Plugin for Notepad++

 XML Plugin Packages for Atom Editor

 XML 1.1 Changes and Parsing Examples

 Archived Tutorials

 References

 Full Version in PDF/EPUB