Difference between revisions of "Include Element"

Jump to navigation Jump to search
87 bytes added ,  14:33, 3 May 2011
Rebranding XML "traits" as "attributes"; cleaning up notes
imported>Low Post
(Added some Notes)
imported>JRoush
(Rebranding XML "traits" as "attributes"; cleaning up notes)
Line 1: Line 1:
The Include element has special meaning for the Oblivion XML parser, similar to that of the ''include'' statement in C-style programming languages.  An <include> element must be empty (no child elements or text/numerical contents), and it must have a '''src''' trait specified:
The Include element has special meaning for the Oblivion XML parser, similar to that of the ''include'' statement in C-style programming languages.  An <include> element must be empty (no child elements or text/numerical contents), and it must have a [[XML Attribute|src]] attribute specified:
  &lt;!-- Includes the xml code for a generic clickable button --&gt;
  &lt;!-- Includes the xml code for a generic clickable button --&gt;
  <include src="button_floating.xml" />
  <include src="button_floating.xml" />
Here the value of the '''src''' trait is the name of the xml file to include (relative to ''Oblivion\Data\Menus\Prefabs'').  Each time the parser finds an <include> element, it replaces it with the contents of this file before continuing.
The value of '''src''' is the name of the xml file to include (relative to ''Oblivion\Data\Menus\Prefabs'').  Each time the parser finds an <include> element, it replaces it with the contents of this file before continuing.


=== Notes ===
=== Notes ===
*This  is a bit different from the standard usage of the [[Trait|src trait]] with [[Operator Element]]s, where '''src''' refers to another element rather than a file.
*This  is a bit different from the standard usage of the [[XML Attribute|src]] attribute in [[Operator Element|Operator Elements]].  With operators, '''src'' refers to another element by name and is paired with a [[XML Attribute|trait]] attribute.  With Include, it refers to a file and appears by itself.
*Attempting to include a file that doesn't exist with cause a CTD.
*Attempting to include a file that doesn't exist with cause a CTD.
:*The file path is relative to '''Menus\prefabs\'''
*Spaces are '''not''' allowed in the file path.
:*Spaces are '''not''' allowed in the file path.


[[Category:Oblivion XML]]
[[Category:Oblivion XML]]
Anonymous user

Navigation menu