Contents of an XML element
As well as XML attributes and metadata, an XML element can have either of these two basic types of content:
- Child elements
- A simple value, which can represent simple types such as numbers or dates
Gosu exposes properties and methods on the XML type instances so that you can access or manipulate child elements or
text contents. For example, if an element is not an XSD-based element, access the properties directly, such as in
element.Children.
An element can contain either child elements or simple values, but never both. This distinction is critical for XSD-based types. Gosu handles properties on an element differently depending on whether the element contains a simple value or is a type that can contain child elements.
The Gosu object that represents the element does not directly contain the child elements or the text content. It is the backing type instance for each element that contains the text content. This structure does not affect the way that Gosu provides access to the element or its contents.
See also
