Child pages
  • XmlNode

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\ 

{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[String]\[]{td}{td}[#getAttributeNames]\()
Return all the attribute names of the current node.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getAttributeValue]\()
Return the value of the named attribute.{td}{tr}{tbody}{tbody}{tr}{td}[XmlNode]\[]{td}{td}[#getChildNodes]\()
Return the child nodes of the current node.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getName]\()
Return the name of the XML node element.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getTextValue]\()
Return the text-value of the XML node element.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getType]\()
Return the type of the XML node element.{td}{tr}{tbody}{table}\\ 

{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7}{tr:id=name}{td}h6.getAttributeNames{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getAttributeNames{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_des|text=|trigger=button}{sub-section}{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_des|trigger=none|class=sIndent}Return all the attribute names of the current node.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_ret|text=|trigger=button}{sub-section}{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_see|text=|trigger=button}{sub-section}{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_see|text=|trigger=button}{sub-section}{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_sam|text=|trigger=button}{sub-section}{sub-section:C341FB6E86F8CE61-582871FA-40994E77-B9C6AC32-DE8D9A58431F4B807F576CC7_sam|class=sIndent|trigger=none}{code:language=javascript}
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)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81}{tr:id=name}{td}h6.getAttributeValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAttributeValue{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_des|text=|trigger=button}{sub-section}{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_des|trigger=none|class=sIndent}Return the value of the named attribute.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_ret|text=|trigger=button}{sub-section}{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_see|text=|trigger=button}{sub-section}{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_see|text=|trigger=button}{sub-section}{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_sam|text=|trigger=button}{sub-section}{sub-section:E28A6286F091DD90-6507DE90-4774457D-98638726-4DD7CEBFE758739257F9CE81_sam|class=sIndent|trigger=none}{code:language=javascript}
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)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1}{tr:id=name}{td}h6.getChildNodes{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[XmlNode]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getChildNodes{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_des|text=|trigger=button}{sub-section}{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_des|trigger=none|class=sIndent}Return the child nodes of the current node.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_ret|text=|trigger=button}{sub-section}{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_ret|trigger=none|class=sIndent}[XmlNode]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_see|text=|trigger=button}{sub-section}{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_see|text=|trigger=button}{sub-section}{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_sam|text=|trigger=button}{sub-section}{sub-section:310CA189C7EEF4D9-E69A80B0-4BC24B53-832AB58F-BDE21FE9D563FEE7224D49B1_sam|class=sIndent|trigger=none}{code:language=javascript}
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())
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA}{tr:id=name}{td}h6.getName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_des|text=|trigger=button}{sub-section}{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_des|trigger=none|class=sIndent}Return the name of the XML node element.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_ret|text=|trigger=button}{sub-section}{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_see|text=|trigger=button}{sub-section}{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_see|text=|trigger=button}{sub-section}{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_sam|text=|trigger=button}{sub-section}{sub-section:8E42673C4303CA87-3DB5CFF5-45BF4734-AA2385A3-435D9BF902884CED9709FADA_sam|class=sIndent|trigger=none}{code:language=javascript}
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())
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A}{tr:id=name}{td}h6.getTextValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getTextValue{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_des|text=|trigger=button}{sub-section}{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_des|trigger=none|class=sIndent}Return the text-value of the XML node element.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_ret|text=|trigger=button}{sub-section}{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_see|text=|trigger=button}{sub-section}{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_see|text=|trigger=button}{sub-section}{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_sam|text=|trigger=button}{sub-section}{sub-section:8B6EC951F0E98FCD-0BEA9D33-44BC4004-B8379035-668AF4B831264D09F480443A_sam|class=sIndent|trigger=none}{code:language=javascript}
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())
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D}{tr:id=name}{td}h6.getType{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getType{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_des|text=|trigger=button}{sub-section}{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_des|trigger=none|class=sIndent}Return the type of the XML node element.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_ret|text=|trigger=button}{sub-section}{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_see|text=|trigger=button}{sub-section}{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_see|text=|trigger=button}{sub-section}{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_sam|text=|trigger=button}{sub-section}{sub-section:359A51E6CEB4B550-AF2EE044-47624883-ADB9AF17-D66CB4A61C62BF029C79A81D_sam|class=sIndent|trigger=none}{code:language=javascript}
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())
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}