Difference between revisions of "Include Element"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>JRoush
(Rebranding XML "traits" as "attributes"; cleaning up notes)
Line 10: Line 10:


[[Category:Oblivion XML]]
[[Category:Oblivion XML]]
H

Revision as of 12:24, 21 December 2023

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 attribute specified:

<!-- Includes the xml code for a generic clickable button -->
<include src="button_floating.xml" />

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

  • This is a bit different from the standard usage of the src attribute in Operator Elements. With operators, 'src refers to another element by name and is paired with a 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.
  • Spaces are not allowed in the file path.

H