Setbody(), Genxml() – BrightSign Object Reference Manual (FW 5.1) User Manual

Page 42

Advertising
background image

34

SetBody(a As Object): Generates an roXMLList for the body if needed. The method then adds the passed
item (which should be an roXMLElement tag).

AddBodyElement() As Object

AddElement(a As String) As Object

AddElementWithBody(a As String, b As Object) As Object

AddAttribute(a As String, b As String)

SetName(a As String)

Parse(a As String) As Boolean: Parses the XML content passed to it. In the event of failure, this method
returns False. However, it also populates roXMLElement with whatever text could be successfully parsed. To avoid
passing along erroneous strings, it is always best to have the script check the return value of

Parse() before

using them.

GenXML(a As Object) As String: Generates XML content. This method takes a single Boolean parameter,
indicating whether or not the XML should have an

<?xml …> tag at the top.

Clear()

GenXMLHdr(a As String) As String

IsName(a As String) As Boolean

HasAttribute(a As String) As Boolean

ParseFile(a As String) As Boolean


Example: The following is an example subroutine to print out the contents of an roXMLElement tree:
PrintXML(root, 0)

Sub

PrintXML(element As

Object, depth As

Integer)

print tab(depth*3);"Name: ";element.GetName()

if not element.GetAttributes().IsEmpty() then

print tab(depth*3);"Attributes: ";

for each a in element.GetAttributes()

Advertising