Child pages
  • XmlReader

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hiddendiv:style=display:none}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACTAUTO CHANGES FROMUPDATE THE PAGECONTENT ANDTHROUGH MERGETHE THEM BACK INTO SERVOY SOURCE{hiddenDOC GENERATOR{div}
{sub-sectiondiv:id=description|text=}{sub-sectiondiv}\\ 

{table:id=|class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[XmlNode]{span}{td}{tr}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[XmlNode]\[]{td}{td}[#readXmlDocumentFromFile]\(argument)
Reads an XML document from a file.{td}{tr}{tbody}{tbody}{tr}{td}[XmlNode]\[]{td}{td}[#readXmlDocumentFromString]\(argument)
Reads an XML document from a string.{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=readXmlDocumentFromFile-Object|class=node}{tr:id=name}{td}h6.readXmlDocumentFromFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[XmlNode]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}readXmlDocumentFromFile{span}{span:id=iets|style=float: left;}\(argument){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:readXmlDocumentFromFile-Object_des|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromFile-Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readXmlDocumentFromFile-Object_snc|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromFile-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readXmlDocumentFromFile-Object_prs|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromFile-Object_prs|trigger=none|div:class=sIndent}\{[Object]} argument
{sub-sectiondiv}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readXmlDocumentFromFile-Object_ret|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromFile-Object_ret|trigger=none|div:class=sIndent}[XmlNode]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readXmlDocumentFromFile-Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readXmlDocumentFromFile-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readXmlDocumentFromFile-Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readXmlDocumentFromFile-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readXmlDocumentFromFile-Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readXmlDocumentFromFile-Object_sam|trigger=none}{code:language=javascript}
// specifies a reference to a file containing valid XML
var xmlNodes = plugins.XmlReader.readXmlDocumentFromFile('c:/test.xml');
var childNodes = xmlNodes[0].getChildNodes();
// shows a dialog to open an xml file, then reads the file
var xmlFile = plugins.file.showFileOpenDialog(1);
var xmlNodes = plugins.XmlReader.readXmlDocumentFromFile(xmlFile);
var childNodes = xmlNodes[0].getChildNodes();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=readXmlDocumentFromString-String|class=node}{tr:id=name}{td}h6.readXmlDocumentFromString{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[XmlNode]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}readXmlDocumentFromString{span}{span:id=iets|style=float: left;}\(argument){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:readXmlDocumentFromString-String_des|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromString-String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:readXmlDocumentFromString-String_snc|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromString-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:readXmlDocumentFromString-String_prs|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromString-String_prs|trigger=none|div:class=sIndent}\{[String]} argument
{sub-sectiondiv}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:readXmlDocumentFromString-String_ret|trigger=button|text=}{sub-section}{sub-section:readXmlDocumentFromString-String_ret|trigger=none|div:class=sIndent}[XmlNode]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:readXmlDocumentFromString-String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readXmlDocumentFromString-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:readXmlDocumentFromString-String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readXmlDocumentFromString-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:readXmlDocumentFromString-String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:readXmlDocumentFromString-String_sam|trigger=none}{code:language=javascript}
var xmlString = '<books><book price="44.95">' +
'<title>Core Java 1.5</title>' +
'<author>Piet Klerksen</author>' +
'<nrPages>1487</nrPages>' +
'</book>' +
'<book price="59.95">' +
'<title>Developing with Servoy</title>' +
'<author>Cheryl Owens and others</author><nrPages>492</nrPages></book></books>';
var xmlNodes = plugins.XmlReader.readXmlDocumentFromString(xmlString);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}