Nif Format/NifTools XML Format

From NifTools
Revision as of 20:02, 8 September 2006 by Shon (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The NifTools XML format is used to describe the NIF, KF, and KFM file formats. NifSkope uses this file directly and almost any new discoveries about the format can be enabled in NifSkope by editing the nif.xml file included in its install directory. Niflib uses the XML file as well; Python scripts read the XML file and generate some of the source code used by Niflib to read and write NIF files. The XML files also contain our human-readable documentation of the format, and will eventually serve as the source for a new HTML version of the file format specification. Thus, these XML files are central to our efforts to understand the file formats and create tools that support as many games as possible.

Contents

The Basics

If you've never heard of XML before, you may want to check out a few of these informational links borrowed from Wikipedia:

If you've ever worked with HTML, XML will look very familiar to you. Basically, instead of working with tags like <B>, <IMG>, and <TABLE>, you will be working with special tags designed to describe the NIF file format such as <basic>, <compound>, and <niobject>.

Every XML file starts with a basic heading. Following is the heading for the NifTools XML format. It doesn't really do anything important other than tell you that this document is in the NifTools XML format, and it has to be there:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE niftoolsxml>
<niftoolsxml version="0.7.0.0">

   XML File contents go here

</niftoolsxml>

Organization

The NIF XML file is divided into sections based around the five main tags. These are; <version>, <basic>, <enum>, <compound>, and <niobject>. At the top of each section is an XML comment. Just like in HTML, a comment is text that is ignored by the program reading the XML file. For example:

<!--This text is for informational use and will be ignored by NifSkope-->

Tags

This section will introduce each tag and explain how to use it. Tags which appear inside other tags will be grouped under the tag which they are most likely to appear inside of

<niftoolsxml>

The <niftoolsxml> tag is the root tag, and everything else in the file goes inside it, similar to the way the <HTML> tag works for HTML documents.

Attributes:

Name Format Description
version #.#.#.# Used to specify the version of the NifTools XML format being used.

Example:

<niftoolsxml version="0.7.0.0"><niftoolsxml>

<version>

<basic>

<enum>

<choice>

<compound>

<niobject>

<add>

Personal tools