Documentation-Set Nodes Schema Reference

This chapter describes the element structure of the Nodes.xml (nodes) file used in documentation sets.

The schema for the nodes file, NodesSchema.rng, is located in the DocSetAccess framework in <Xcode>/Library/PrivateFrameworks/DocSetAccess.framework.

Listing C-1 lists the topology of the elements of a nodes file.

Listing C-1  Nodes.xml element topology

DocSetNodes
   TOC
      Node
         Name
         URL
         Path
         File
         Anchor
         Subnodes
            Node
            NodeRef
      NodeRef
         Subnodes
   Library
      Node

DocSetNodes

Root element of the nodes file.

DocSetNodes [version]
   TOC
   Library

Attributes

Name

Type

Description

version

Decimal

The version number of the NodesSchema.rng file. The only supported version is 1.0.

Subelements

Cardinality

Element

1

TOC

0..1

Library

TOC

Defines the document hierarchy.

TOC []
   Node|NodeRef

Attributes

None.

Subelements

Cardinality

Element

Usage

1

Node or NodeRef

Although this element must contain a Name element, the Documentation window actually displays the localized documentation set name (specified by the CFBundleName property) for this root node.

The documentation set name is displayed in the Home pop-up menu in the Documentation window.

Node

Represents a single node in the document hierarchy.

Node [ id,type,isPrimaryTOCNode,noindex]
   Name
   URL
   Path
   File
   Anchor
   Subnodes

A node represents a file or a group of files within the documentation set. A node is associated with a location in the HTML files, specified by a combination of its URL, Path, File and Anchor subelements.

See Specifying Subnodes for usage details.

Attributes

Name

Type

Description

id

Integer

Optional. This unique—within the documentation set—identifier allows the node to be referenced elsewhere in the Nodes.xml or Tokens.xml files.

type

String

Optional. Specifies the node type. Values: file (default), folder, bundle.

isPrimaryTOCNode

Boolean

Optional. Indicates whether the node represents the primary TOC location of the document the node represents. This is relevant only if this node appears in the node hierarchy multiple times. Default: false.

noindex

Boolean

Optional. Species whether the node is excluded from the documentation set’s indexes and from any searches. Default: false.

Subelements

Cardinality

Element

Usage

1

Name

Specifies the node’s name, which appears in the Documentation window.

0..1

URL

Specifies the location of the files the node represents.

0..1

Path

Specifies the location of the files the node represents.

0..1

File

Specifies the name of the file the node represents.

0..1

Anchor

Specifies a scroll-to location within the node’s landing page.

0..1

Subnodes

Defines a group of subnodes.

Name

Specifies a name.

Name [] {string}

Attributes

None.

Content

String.

Subnodes

Defines a list of nodes.

Subnodes []
   Node,NodeRef

Attributes

None.

Subelements

Cardinality

Element

1..*

Node

NodeRef

NodeRef

Refers to a node defined elsewhere in the nodes file.

NodeRef [refid, isPrimaryTOCNode]
   Subnodes

You can also use this element in tokens files to associate a symbol with a documentation node. This is useful when a Node element describing the symbol’s reference documentation already exists.

When it appears within a Subnodes or TOC element, a NodeRef is treated as if the Node element it references was itself listed there. This allows a document to be listed multiple times in the document hierarchy of the documentation set.

Attributes

Name

Type

Description

refid

Integer

Specifies the id of the referenced node.

isPrimaryTOCNode

Boolean

Optional. Indicates whether the node represents the primary TOC location of the document the node represents. Default: false.

Subelements

Cardinality

Element

Usage

0..1

Subnodes

Defines a group of subnodes. These subnodes are used only when the node identified by the refid attribute does not contain subnodes.

URL

Specifies the base location of the node’s documentation as a URL.

URL [] {URL}

When used alone, the URL element is interpreted as the full path to the file to load when the user selects the node. See Specifying the Location of a Documentation Node for details about using this element with other Node subelements.

Attributes

None.

Content

URL.

Path

Specifies the path to the file or directory associated with a node.

Path [] {filepath}

The Path element can specify:

See Specifying the Location of a Documentation Node for details about using this element with other Node subelements.

Attributes

None.

Content

Filepath.

File

Specifies a filename.

File [] {normalizedString}

See Specifying the Location of a Documentation Node for details about using this element with other Node subelements.

Attributes

None.

Content

Normalized string.

Anchor

Identifies a scroll-to-here location within a node's landing page.

Anchor [] {normalizedString}

See Specifying the Location of a Documentation Node for details about using this element with other Node subelements.

Attributes

None.

Content

Normalized string.

Library

Defines a library of nodes.

Library []
   Node

See Creating a Library of Node Definitions for usage details.

Attributes

None.

Subelements

Cardinality

Element

1..*

Node