Drag[en]gine Script Module DragonScript Script API  1.0
EasyXMLElement Class Reference

XML element. More...

Inheritance diagram for EasyXMLElement:

Classes

enum  eElementTypes
 

Public Member Functions

Constructors
EasyXMLElement new (int type)
 Create element. More...
 
Management
int getLine ()
 Line number of tag. More...
 
int getPosition ()
 Position on line of tag. More...
 
int getType ()
 Type of element. More...
 
String getTagName ()
 Name of tag. More...
 
void setTagName (String name)
 Set name of tag. More...
 
String getCDataContent ()
 Character data content. More...
 
void setCDataContent (String content)
 Set character data content. More...
 
String getComment ()
 Comment. More...
 
void setComment (String comment)
 Set comment. More...
 
Attributes
int getAttributeCount ()
 Number of attributes. More...
 
String getAttributeNamed (String name)
 Named attribute. More...
 
bool hasAttributeNamed (String name)
 Named attribute is present. More...
 
void setAttribute (String name, String value)
 Set attribute. More...
 
void setAttribute (String name, int value)
 Set attribute. More...
 
void setAttribute (String name, float value)
 Set attribute. More...
 
void setAttribute (String name, bool value)
 Set attribute. More...
 
void removeAttributeNamed (String name)
 Remove named attribute if present. More...
 
void removeAllAttributes ()
 Remove all attributes. More...
 
Child elements
int getElementCount ()
 Number of child elements. More...
 
void hasElement (EasyXMLElement child)
 Child element is present. More...
 
EasyXMLElement getElementAt (int index)
 Child element at index. More...
 
void addElement (EasyXMLElement child)
 Add child element. More...
 
void removeElement (EasyXMLElement child)
 Remove child element. More...
 
void removeAllElements ()
 Remove all child elements. More...
 
EasyXMLElement addTag (String name)
 Add element of type TAG with name. More...
 
int getFirstCDataInt ()
 First child CData converted to integer or 0 if absent. More...
 
float getFirstCDataFloat ()
 First child CData converted to string or 0.0 if absent. More...
 
bool getFirstCDataBool ()
 First child CData converted to boolean or false if absent. More...
 

Detailed Description

XML element.

This is a native class.

Member Function Documentation

◆ addElement()

void addElement ( EasyXMLElement  child)

Add child element.

Elements can only be child of one parent at each time.

Exceptions
EInvalidParamElement is already a child of another parent.

◆ addTag()

EasyXMLElement addTag ( String  name)

Add element of type TAG with name.

◆ getAttributeCount()

int getAttributeCount ( )

Number of attributes.

◆ getAttributeNamed()

String getAttributeNamed ( String  name)

Named attribute.

Exceptions
EInvalidParamNamed attribute is absent.

◆ getCDataContent()

String getCDataContent ( )

Character data content.

◆ getComment()

String getComment ( )

Comment.

◆ getElementAt()

EasyXMLElement getElementAt ( int  index)

Child element at index.

Exceptions
EOutOfBoundaryindex is less than 0 or greater than or equal to getElementCount().

◆ getElementCount()

int getElementCount ( )

Number of child elements.

◆ getFirstCDataBool()

bool getFirstCDataBool ( )

First child CData converted to boolean or false if absent.

CData with text "true", "yes" or "1" are converted to true. CData with text "false", "no" or "0" are converted to false. All other CData text are converted to false.

◆ getFirstCDataFloat()

float getFirstCDataFloat ( )

First child CData converted to string or 0.0 if absent.

◆ getFirstCDataInt()

int getFirstCDataInt ( )

First child CData converted to integer or 0 if absent.

◆ getLine()

int getLine ( )

Line number of tag.

◆ getPosition()

int getPosition ( )

Position on line of tag.

◆ getTagName()

String getTagName ( )

Name of tag.

◆ getType()

int getType ( )

Type of element.

◆ hasAttributeNamed()

bool hasAttributeNamed ( String  name)

Named attribute is present.

◆ hasElement()

void hasElement ( EasyXMLElement  child)

Child element is present.

◆ new()

EasyXMLElement new ( int  type)

Create element.

◆ removeAllAttributes()

void removeAllAttributes ( )

Remove all attributes.

◆ removeAllElements()

void removeAllElements ( )

Remove all child elements.

◆ removeAttributeNamed()

void removeAttributeNamed ( String  name)

Remove named attribute if present.

◆ removeElement()

void removeElement ( EasyXMLElement  child)

Remove child element.

◆ setAttribute() [1/4]

void setAttribute ( String  name,
String  value 
)

Set attribute.

If attribute is present its value is changed. Otherwise a new attribute is added.

◆ setAttribute() [2/4]

void setAttribute ( String  name,
int  value 
)

Set attribute.

If attribute is present its value is changed. Otherwise a new attribute is added.

◆ setAttribute() [3/4]

void setAttribute ( String  name,
float  value 
)

Set attribute.

If attribute is present its value is changed. Otherwise a new attribute is added.

◆ setAttribute() [4/4]

void setAttribute ( String  name,
bool  value 
)

Set attribute.

If attribute is present its value is changed. Otherwise a new attribute is added.

◆ setCDataContent()

void setCDataContent ( String  content)

Set character data content.

◆ setComment()

void setComment ( String  comment)

Set comment.

◆ setTagName()

void setTagName ( String  name)

Set name of tag.


The documentation for this class was generated from the following file: