How to create xml file in notepad – Nishan Blog

An XML file is a simple text file. So, simply create a new file in notepad and save it as with .xml file extension. That would be it. A new xml file is created.

An XML document can contain international characters, when saving in notepad it is possible to set the encoding as UTF-8. (HTML and CSS defaults are also UTF-8)

Optionally, it is possible to set the so called xml prolog or declaration in the beginning of the document:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 

But this is optional with 1.0! If it exist then it must be at the beginning of the first line. The encoding and standalone parts are optional, so it is possible to just write

<?xml version="1.0"?> 

In case one wants to create an XML 1.1 file then the prolog or document type declaration is mandatory.

<?xml version="1.1"?> 

Definition: XML 1.1 documents must begin with an XML declaration which specifies the version of XML being used.

How To: Create an empty XML file

Summary

Empty XML files are useful for creating metadata templates and for creating metadata documents describing resources that are not available online. For example, you might create an empty XML file and then use a metadata editor to add information describing a paper map, an atlas, or data that has been archived on tape.

Procedure

To manually create an empty XML file:

  1. Open a text editor such as Notepad.
  2. Copy the following lines and paste them into the text editor:
<?xml version="1.0" ?> <metadata> </metadata>
  1. Save this text as an .xml file. For example, using Notepad:
    a. Select File > Save As.
    b. In the Save as type drop-down list, select All Types.
    c. In the File name text box type the filename including the .xml extension.
Warning: Do not name the file "metadata.xml"; ArcCatalog will assume it contains metadata describing the folder in which it was saved. Also, do not use more than one file extension; with a name like "myFile.txt.xml" XML files will not appear in the Contents list because ArcCatalog assumes the file contains metadata describing an item that is already listed.
  1. In ArcCatalog, right-click the folder in which the new XML file was saved and click Refresh.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

close