Child pages
  • XmlNode
Skip to end of metadata
Go to start of metadata

Refresh page Mar 28, 2024 23:59

Supported Clients
SmartClient WebClient NGClient

Methods Summary
Array getAttributeNames() Return all the attribute names of the current node.
String getAttributeValue(attributeName) Return the value of the named attribute.
Array getChildNodes() Return the child nodes of the current node.
String getName() Return the name of the XML node element.
String getTextValue() Return the text-value of the XML node element.
String getType() Return the type of the XML node element.

Methods Details

getAttributeNames()

Return all the attribute names of the current node.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

nodes = plugins.XmlReader.readXmlDocumentFromString("<root attr1='value1' attr2='value2'/>")
rootNode = nodes[0];
attributes = rootNode.getAttributeNames();
application.output(attributes[0])
application.output(attributes[1])
val1 = rootNode.getAttributeValue('attr1');
application.output(val1)

getAttributeValue(attributeName)

Return the value of the named attribute.

Parameters

String attributeName ;

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

nodes = plugins.XmlReader.readXmlDocumentFromString("<root attr1='value1' attr2='value2'/>")
rootNode = nodes[0];
attributes = rootNode.getAttributeNames();
application.output(attributes[0])
application.output(attributes[1])
val1 = rootNode.getAttributeValue('attr1');
application.output(val1)

getChildNodes()

Return the child nodes of the current node.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

nodes = plugins.XmlReader.readXmlDocumentFromString('<father><child1>John</child1><child2>Mary</child2></father>');
application.output(nodes[0].getName())
application.output(nodes[0].getTextValue())
application.output(nodes[0].getType())
childs = nodes[0].getChildNodes()
application.output(childs[0].getName())
application.output(childs[0].getTextValue())
application.output(childs[0].getType())
subChilds = childs[0].getChildNodes()
application.output(subChilds[0].getName())
application.output(subChilds[0].getTextValue())
application.output(subChilds[0].getType())

getName()

Return the name of the XML node element.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

nodes = plugins.XmlReader.readXmlDocumentFromString('<father><child1>John</child1><child2>Mary</child2></father>');
application.output(nodes[0].getName())
application.output(nodes[0].getTextValue())
application.output(nodes[0].getType())
childs = nodes[0].getChildNodes()
application.output(childs[0].getName())
application.output(childs[0].getTextValue())
application.output(childs[0].getType())
subChilds = childs[0].getChildNodes()
application.output(subChilds[0].getName())
application.output(subChilds[0].getTextValue())
application.output(subChilds[0].getType())

getTextValue()

Return the text-value of the XML node element.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

nodes = plugins.XmlReader.readXmlDocumentFromString('<father><child1>John</child1><child2>Mary</child2></father>');
application.output(nodes[0].getName())
application.output(nodes[0].getTextValue())
application.output(nodes[0].getType())
childs = nodes[0].getChildNodes()
application.output(childs[0].getName())
application.output(childs[0].getTextValue())
application.output(childs[0].getType())
subChilds = childs[0].getChildNodes()
application.output(subChilds[0].getName())
application.output(subChilds[0].getTextValue())
application.output(subChilds[0].getType())

getType()

Return the type of the XML node element.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

nodes = plugins.XmlReader.readXmlDocumentFromString('<father><child1>John</child1><child2>Mary</child2></father>');
application.output(nodes[0].getName())
application.output(nodes[0].getTextValue())
application.output(nodes[0].getType())
childs = nodes[0].getChildNodes()
application.output(childs[0].getName())
application.output(childs[0].getTextValue())
application.output(childs[0].getType())
subChilds = childs[0].getChildNodes()
application.output(subChilds[0].getName())
application.output(subChilds[0].getTextValue())
application.output(subChilds[0].getType())

  • No labels