Converting XML in Pretty Print Format

This section provides a tutorial example on how to convert XML documents into pretty print format using XML Notepad 2007.

If have an XML document which is not nicely formatted, you can use XML Notepad 2007 to reformat it into a pretty print layout.

1. Run "XML Notepad 2007" again, You see an empty "Tree View" showing up.

2. Copy the following XML document:

<?xml version="1.0"?>
<user status="active"><!-- This is not a real user. -->
<first_name>John</first_name><last_name>Smith</last_name><address>
<street>1234 Main Road</street><city>Bellville</city></address></user>

3. Paste it into the "Tree View" of XML Notepad 2007. You see XML elements are created from the pasted XML document.

4. Click menu "File" > "Save as..." and save the it as "user.xml".

5. Open "user.xml" in Notepad. You see the XML document is nicely formatted now:

<?xml version="1.0" encoding="utf-8"?>
<user status="active">
  <!-- This is not a real user. -->
  <first_name>John</first_name>
  <last_name>Smith</last_name>
  <address>
    <street>1234 Main Road</street>
    <city>Bellville</city>
  </address>
</user>

Table of Contents

 About This Book

 Introduction of XML (eXtensible Markup Language)

 XML File Syntax

 XML File 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

 What Is XML Notepad

 Downloading and Installing XML Notepad

 Creating XML Documents in Tree View

 Viewing XML Documents in Source Code

Converting XML in Pretty Print Format

 XSD Validation and Error List

 XSLT Transformation and HTML View

 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