{"id":3165,"date":"2019-03-25T17:43:00","date_gmt":"2019-03-25T20:43:00","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/reading-data-from-an-xml-file-in-e3\/"},"modified":"2019-06-10T13:46:55","modified_gmt":"2019-06-10T16:46:55","slug":"reading-data-from-an-xml-file-in-e3","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/","title":{"rendered":"Reading data from an XML file in E3."},"content":{"rendered":"<div align=\"justify\">\n<p><b>1) Introduction<\/b><\/p>\n<p>This article shows you how to collect data from an XML file.<\/p>\n<p><b>2) XML file<\/b><\/p>\n<p>XML (EXtensible Markup Language) is a format for creating documents where data is organized hierarchically. It is frequently present in formatted text documents, vector images, or databases. Its main purpose is to make it easier to share information on the internet.<\/p>\n<p>In this article, we will use an XML file with the following structure:<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4850\/picture_2.png\" alt=\"\" width=\"440\" height=\"166\" align=\"Baseline\" border=\"0\" \/><\/div>\n<p>The first line in this file shows <b>Elipse <\/b>section. This section has two child elements: <b>Company <\/b>and <b>Data<\/b>. <b>Data <\/b>has the information on the company.<\/p>\n<p><b>3) Script to read the file <\/b><\/p>\n<p>To access this information in E3, you will need to create the <b>DOMDocument <\/b>object, which will grant access to the file&#8217;s methods and properties. You will need to set up <i>async <\/i>property as false.<\/p>\n<p><span style=\"font-family: Courier New\">set docxml = createobject(&#8220;MSXML2.DOMDocument&#8221;)<\/p>\n<p>docxml.async = false<\/span><\/p>\n<p>The <i>Load <\/i>method will load the desired XML document:<\/p>\n<p><span style=\"font-family: Courier New\">docxml.load(&#8220;.\\Test.xml&#8221;)<\/span><\/p>\n<p>From this point on, you will be able to access the elements in the XML file via <i>SelectSingleNode <\/i>method, which will grant access to the informed element.<\/p>\n<p><span style=\"font-family: Courier New\">set EleElipse = docxml.SelectSingleNode(&#8220;Elipse\/Company&#8221;)<\/span><\/p>\n<p>However, to access its value, you must use <i>Text <\/i>method:<\/p>\n<p><span style=\"font-family: Courier New\">company = EleElipse.Text<\/span><\/p>\n<p>To access the child elements in <b>Data<\/b>, you will need to use <i>ChildNodes <\/i>method, and pass the child element&#8217;s index:<\/p>\n<p><span style=\"font-family: Courier New\">set EleChild = EleData.ChildNodes(0)<br \/>\nrua = EleChild.Text<\/span><\/p>\n<p>The whole script:<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4850\/picture_3.png\" alt=\"\" width=\"467\" height=\"194\" align=\"Baseline\" border=\"0\" \/><\/div>\n<p><b><br \/>\n4) Demo application <\/b><\/p>\n<p>Attached to this article are both a demo application (developed with E3 version 4.0 build 225) and the XML file (in the same folder as the .dom and .prj files).<\/p>\n<p>A ListBox object that shows the returned data and a button with the script to be executed were added to the screen.<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4850\/xml_english.png\" alt=\"\" width=\"550\" height=\"420\" align=\"Baseline\" border=\"0\" \/><\/div>\n<p><b>5) References<\/b><\/p>\n<p>1. <a href=\"http:\/\/msdn.microsoft.com\/pt-br\/library\/aa925430.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft MSDN Library Online<\/a><\/p>\n<p>2. <a href=\"http:\/\/www.w3schools.com\/dom\/default.asp\" target=\"_blank\" rel=\"noopener noreferrer\">W3Schools<\/a><\/p>\n<p>3. <a href=\"http:\/\/www.scriptbrasil.com.br\/download\/codigo\/6785\/\" target=\"_blank\" rel=\"noopener noreferrer\">ScriptBrasil<\/a><\/p>\n<h3>Attachments:<\/h3>\n<p><a href=\"\/wp-content\/uploads\/2019\/03\/Reading_XML.zip\">Reading_XML<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1) Introduction This article shows you how to collect data from an XML file. 2) XML file XML (EXtensible Markup Language) is a format for creating documents where data is&hellip;<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[763],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Reading data from an XML file in E3. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Reading data from an XML file in E3.\" \/>\n<meta property=\"og:description\" content=\"1) Introduction This article shows you how to collect data from an XML file. 2) XML file XML (EXtensible Markup Language) is a format for creating documents where data is&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:43:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-10T16:46:55+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4850\/picture_2.png\" \/>\n<meta name=\"author\" content=\"C\u00e9zar Lumiatti Teixeira\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"C\u00e9zar Lumiatti Teixeira\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/\"},\"author\":{\"name\":\"C\u00e9zar Lumiatti Teixeira\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b\"},\"headline\":\"Reading data from an XML file in E3.\",\"datePublished\":\"2019-03-25T20:43:00+00:00\",\"dateModified\":\"2019-06-10T16:46:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/\"},\"wordCount\":303,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/\",\"name\":\"[:pt]Reading data from an XML file in E3.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:43:00+00:00\",\"dateModified\":\"2019-06-10T16:46:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Reading data from an XML file in E3.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b\",\"name\":\"C\u00e9zar Lumiatti Teixeira\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g\",\"caption\":\"C\u00e9zar Lumiatti Teixeira\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/teixeira\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Reading data from an XML file in E3. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]Reading data from an XML file in E3.[:] - Elipse Knowledgebase","og_description":"1) Introduction This article shows you how to collect data from an XML file. 2) XML file XML (EXtensible Markup Language) is a format for creating documents where data is&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:43:00+00:00","article_modified_time":"2019-06-10T16:46:55+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID4850\/picture_2.png"}],"author":"C\u00e9zar Lumiatti Teixeira","twitter_card":"summary_large_image","twitter_misc":{"Written by":"C\u00e9zar Lumiatti Teixeira","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/"},"author":{"name":"C\u00e9zar Lumiatti Teixeira","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b"},"headline":"Reading data from an XML file in E3.","datePublished":"2019-03-25T20:43:00+00:00","dateModified":"2019-06-10T16:46:55+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/"},"wordCount":303,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/","url":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/","name":"[:pt]Reading data from an XML file in E3.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:43:00+00:00","dateModified":"2019-06-10T16:46:55+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/reading-data-from-an-xml-file-in-e3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Reading data from an XML file in E3."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b","name":"C\u00e9zar Lumiatti Teixeira","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g","caption":"C\u00e9zar Lumiatti Teixeira"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/teixeira\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3165"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=3165"}],"version-history":[{"count":2,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3165\/revisions"}],"predecessor-version":[{"id":4339,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3165\/revisions\/4339"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=3165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=3165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=3165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}