This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions.
This article has been viewed 43,421 times.
Learn more...
Files that end in the .xml file extension are plain text files containing XML code. Rather than "execute" them like you would a program or script, you'd simply open it in one of two ways—in a text editor or a web browser. You can also convert the file to a different format using a converter like xmlto.
Steps
Using a Text Editor
-
1Press Control+Alt+T. This opens a terminal window.
-
2Navigate to the directory containing your XML file. You'll use the cd command to do this. For example, cd /usr/local/files takes you to a directory called /usr/local/files.Advertisement
-
3Type vim filename.xml. Replace filename.xml with the name of the XML file you want to view. This opens the file for viewing and editing in VIM.
Using a Web Browser
-
1Navigate to the .xml file you want to view. If you're using Gnome, you can open GNOME Files and double-click the folder where the file is stored. If you're using KDE, the built-in file manager is Dolphin.[1]
-
2Right-click the file and select Open With Other Application. A list of applications will appear.[2]
-
3Select your web browser. Firefox comes preinstalled on many Linux flavors, but you can use any modern web browser—they should all display XML files. This will automatically display the contents of the file.
Converting to Another Format
-
1Press Control+Alt+T. This opens a terminal window.
-
2Update the repository. To make sure you're downloading the latest version of xmlto, the tool yo'ull be using to convert the XML file to plain text, run the command sudo apt update.
-
3Install the xml2 package. To install xmlto, run the command sudo apt install xmlto.
-
4Navigate to the directory containing your XML file. You'll use the cd command to do this. For example, cd /usr/local/files takes you to a directory called /usr/local/files.
-
5Run the command to convert the file to another format. The command you'll use depends on the type of file you want to create:
- xmlto pdf myfile.xml converts to a PDF.[3]
- To convert to another file type, replace pdf with the desired file type, such as: html, htmlhelp (HTML help file), javahelp (Java help file), dvi (text DVI file), man (Unix manual pages), txt (plain text), ps (postscript), xhtml, fo (XSL-FO formatting objects).
References
About This Article
1. Open the file in a web browser if you just want to view it.
2. To edit the file, open it in VIM.
3. Use xtmlto to convert the file to another format.