Castle Game Engine: CastleXMLUtils: Class TDOMElementHelper

# Class TDOMElementHelper
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleXMLUtils ## Declaration `type TDOMElementHelper = class helper(TObject) for TDOMElement` ## Description ## Hierarchy TObject TDOMElementHelper ## Overview ### Methods
| `function AttributeString(const AttrName: string; var Value: string): boolean;`
| `function AttributeURL(const AttrName: string; const BaseUrl: string; var URL: string): boolean;`
| `function AttributeCardinal(const AttrName: string; var Value: Cardinal): boolean;`
| `function AttributeInteger(const AttrName: string; var Value: Integer): boolean;`
| `function AttributeSingle(const AttrName: string; var Value: Single): boolean;`
| `function AttributeFloat(const AttrName: string; var Value: Float): boolean;`
| `function AttributeBoolean(const AttrName: string; var Value: boolean): boolean;`
| `function AttributeString(const AttrName: string): string;`
| `function AttributeURL(const AttrName: string; const BaseUrl: string): string;`
| `function AttributeCardinal(const AttrName: string): Cardinal;`
| `function AttributeInteger(const AttrName: string): Integer;`
| `function AttributeSingle(const AttrName: string): Single;`
| `function AttributeFloat(const AttrName: string): Float;`
| `function AttributeBoolean(const AttrName: string): boolean;`
| `function AttributeStringDef(const AttrName: string; const DefaultValue: string): string;`
| `function AttributeCardinalDef(const AttrName: string; const DefaultValue: Cardinal): Cardinal;`
| `function AttributeIntegerDef(const AttrName: string; const DefaultValue: Integer): Integer;`
| `function AttributeSingleDef(const AttrName: string; const DefaultValue: Single): Single;`
| `function AttributeFloatDef(const AttrName: string; const DefaultValue: Float): Float;`
| `function AttributeBooleanDef(const AttrName: string; const DefaultValue: boolean): boolean;`
## Description ### Methods
| `function AttributeString(const AttrName: string; var Value: string): boolean;`
Read from Element attribute value and returns `True`, or (of there is no such attribute) returns `False` and does not modify Value. Value is a "var", not "out" param, because in the latter case it's guaranteed that the old Value will not be cleared.
| `function AttributeURL(const AttrName: string; const BaseUrl: string; var URL: string): boolean;`
Read from Element attribute value as URL and returns `True`, or (of there is no such attribute) returns `False` and does not modify Value. Returned URL is always absolute. The value in file may be a relative URL, it is resolved with respect to BaseUrl, that must be absolute.
| `function AttributeCardinal(const AttrName: string; var Value: Cardinal): boolean;`
Read from Element attribute value as Cardinal and returns `True`, or (of there is no such attribute) returns `False` and does not modify Value.
| `function AttributeInteger(const AttrName: string; var Value: Integer): boolean;`
Read from Element attribute value as Integer and returns `True`, or (of there is no such attribute) returns `False` and does not modify Value.
| `function AttributeSingle(const AttrName: string; var Value: Single): boolean;`
Read from Element attribute value as Single and returns `True`, or (of there is no such attribute) returns `False` and does not modify Value.
| `function AttributeFloat(const AttrName: string; var Value: Float): boolean;`
Read from Element attribute value as Float and returns `True`, or (of there is no such attribute) returns `False` and does not modify Value.
| `function AttributeBoolean(const AttrName: string; var Value: boolean): boolean;`
Read from Element attribute value as Boolean and returns `True`, or (of there is no such attribute) returns `False` and does not modify Value. A boolean value is interpreted just like FPC's TXMLConfig objects: true is designated by word `true`, false by word `false`, case is ignored. If attribute exists but it's value is not `true` or `false`, then returns `False` and doesn't modify Value paramater. So behaves just like the attribute didn't exist.
| `function AttributeString(const AttrName: string): string;`
Retrieves from Element given attribute as a string, raises EDOMAttributeMissing if missing. ###### Exceptions raised EDOMAttributeMissing
| `function AttributeURL(const AttrName: string; const BaseUrl: string): string;`
Retrieves from Element given attribute as an absolute URL, raises EDOMAttributeMissing if missing. Returned URL is always absolute. The value in file may be a relative URL, it is resolved with respect to BaseUrl, that must be absolute. ###### Exceptions raised EDOMAttributeMissing
| `function AttributeCardinal(const AttrName: string): Cardinal;`
Retrieves from Element given attribute as a Cardinal, raises EDOMAttributeMissing if missing. ###### Exceptions raised EDOMAttributeMissing
| `function AttributeInteger(const AttrName: string): Integer;`
Retrieves from Element given attribute as an Integer, raises EDOMAttributeMissing if missing. ###### Exceptions raised EDOMAttributeMissing
| `function AttributeSingle(const AttrName: string): Single;`
Retrieves from Element given attribute as a Single, raises EDOMAttributeMissing if missing. ###### Exceptions raised EDOMAttributeMissing
| `function AttributeFloat(const AttrName: string): Float;`
Retrieves from Element given attribute as a Float, raises EDOMAttributeMissing if missing. ###### Exceptions raised EDOMAttributeMissing
| `function AttributeBoolean(const AttrName: string): boolean;`
Retrieves from Element given attribute as a boolean, raises EDOMAttributeMissing if missing or has invalid value. A boolean value is interpreted just like FPC's TXMLConfig objects: true is designated by word `true`, false by word `false`, case is ignored. If attribute exists but it's value is not `true` or `false`, then raises EDOMAttributeMissing. So behaves just like the attribute didn't exist. ###### Exceptions raised EDOMAttributeMissing
| `function AttributeStringDef(const AttrName: string; const DefaultValue: string): string;`
Retrieves from Element given attribute as a string, or a default value.
| `function AttributeCardinalDef(const AttrName: string; const DefaultValue: Cardinal): Cardinal;`
Retrieves from Element given attribute as a Cardinal, or a default value.
| `function AttributeIntegerDef(const AttrName: string; const DefaultValue: Integer): Integer;`
Retrieves from Element given attribute as an Integer, or a default value.
| `function AttributeSingleDef(const AttrName: string; const DefaultValue: Single): Single;`
Retrieves from Element given attribute as a Single, or a default value.
| `function AttributeFloatDef(const AttrName: string; const DefaultValue: Float): Float;`
Retrieves from Element given attribute as a Float, or a default value.
| `function AttributeBooleanDef(const AttrName: string; const DefaultValue: boolean): boolean;`
Retrieves from Element given attribute as a boolean, returns a default value if missing or has invalid value.
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:13