{"id":1812,"date":"2017-05-11T22:04:57","date_gmt":"2017-05-11T22:04:57","guid":{"rendered":"http:\/\/elbsolutions.com\/projects\/?p=1812"},"modified":"2022-02-03T11:24:30","modified_gmt":"2022-02-03T17:24:30","slug":"csv-to-xml","status":"publish","type":"post","link":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/","title":{"rendered":"CSV to XML"},"content":{"rendered":"<p>The following is a way to move from CSV to XML Node. If one were to want to manually structure an xml node, \u00a0there is an alternative way to create xml nodes from CSV files that is fast and easy and can be done in the following form:<\/p>\n<p>Dim ReferenceToElement as XElement =<\/p>\n<p>&lt;nameOfTheNode&gt;<\/p>\n<p>&lt;%= <strong>From<\/strong>\u00a0strings <strong>In<\/strong>\u00a0StringArray<\/p>\n<p><strong>Let<\/strong> fields = Split(strs, &#8220;,&#8221;)<\/p>\n<p><strong>Select<\/strong><\/p>\n<p>&lt;rows&gt;<\/p>\n<p>&lt;column1&gt;&lt;%= fields(0)%&gt;&lt;\/column1&gt;<\/p>\n<p>&lt;\/rows&gt;<\/p>\n<p>%&gt;<\/p>\n<p>&lt;\/nameOfTheNode&gt;<\/p>\n<p>This takes in a string taken from the csv file and put in an array called String Array. This then only takes the first item (fields 0), and puts it in the column of the new xelement. Then once this is done the xelement must be converted into a node. \u00a0And this is done in the following code:<\/p>\n<p>Dim xn As XmlNode = XmlDoc.ReadNode(ReferenceToElement.CreateReader)<\/p>\n<p>Now xn can be inserted as a new child or any other task that would need to be done with a xml node. This method allows direct control over the structure of the node without the complexity of creating a table and allows for very fast manipulation of data into a xml node. This is to the advantage of the user as the nodes are a very easy way to insert data into a xml document. Situations could be adding text to an html email or manipulation of data on a website. The most relevant website for this would be the Microsoft developer network on the subject.\u00a0<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb387090(v=vs.100).aspx\">https:\/\/msdn.microsoft.com\/en-us\/library\/bb387090(v=vs.100).aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following is a way to move from CSV to XML Node. If one were to want to manually structure an xml node, \u00a0there is an alternative way to create xml nodes from CSV files that is fast and easy and can be done in the following form: Dim ReferenceToElement as XElement = &lt;nameOfTheNode&gt; &lt;%= [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1812","post","type-post","status-publish","format-standard","hentry","category-general"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CSV to XML - ELB Solutions.com Inc.<\/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:\/\/elbsolutions.com\/projects\/csv-to-xml\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSV to XML - ELB Solutions.com Inc.\" \/>\n<meta property=\"og:description\" content=\"The following is a way to move from CSV to XML Node. If one were to want to manually structure an xml node, \u00a0there is an alternative way to create xml nodes from CSV files that is fast and easy and can be done in the following form: Dim ReferenceToElement as XElement = &lt;nameOfTheNode&gt; &lt;%= [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/\" \/>\n<meta property=\"og:site_name\" content=\"ELB Solutions.com Inc.\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-11T22:04:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T17:24:30+00:00\" \/>\n<meta name=\"author\" content=\"Etienne Bley\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Etienne Bley\" \/>\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:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/\"},\"author\":{\"name\":\"Etienne Bley\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"headline\":\"CSV to XML\",\"datePublished\":\"2017-05-11T22:04:57+00:00\",\"dateModified\":\"2022-02-03T17:24:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/\"},\"wordCount\":269,\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/\",\"name\":\"CSV to XML - ELB Solutions.com Inc.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\"},\"datePublished\":\"2017-05-11T22:04:57+00:00\",\"dateModified\":\"2022-02-03T17:24:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/csv-to-xml\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSV to XML\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\",\"name\":\"ELB Solutions.com Inc.\",\"description\":\"Bringing all your IT Pieces together\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\",\"name\":\"Etienne Bley\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"caption\":\"Etienne Bley\"},\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/author\\\/etienne-bley\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSV to XML - ELB Solutions.com Inc.","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:\/\/elbsolutions.com\/projects\/csv-to-xml\/","og_locale":"en_US","og_type":"article","og_title":"CSV to XML - ELB Solutions.com Inc.","og_description":"The following is a way to move from CSV to XML Node. If one were to want to manually structure an xml node, \u00a0there is an alternative way to create xml nodes from CSV files that is fast and easy and can be done in the following form: Dim ReferenceToElement as XElement = &lt;nameOfTheNode&gt; &lt;%= [&hellip;]","og_url":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/","og_site_name":"ELB Solutions.com Inc.","article_published_time":"2017-05-11T22:04:57+00:00","article_modified_time":"2022-02-03T17:24:30+00:00","author":"Etienne Bley","twitter_misc":{"Written by":"Etienne Bley","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/#article","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/"},"author":{"name":"Etienne Bley","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"headline":"CSV to XML","datePublished":"2017-05-11T22:04:57+00:00","dateModified":"2022-02-03T17:24:30+00:00","mainEntityOfPage":{"@id":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/"},"wordCount":269,"articleSection":["General"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/","url":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/","name":"CSV to XML - ELB Solutions.com Inc.","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/#website"},"datePublished":"2017-05-11T22:04:57+00:00","dateModified":"2022-02-03T17:24:30+00:00","author":{"@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"breadcrumb":{"@id":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elbsolutions.com\/projects\/csv-to-xml\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elbsolutions.com\/projects\/csv-to-xml\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elbsolutions.com\/projects\/"},{"@type":"ListItem","position":2,"name":"CSV to XML"}]},{"@type":"WebSite","@id":"https:\/\/elbsolutions.com\/projects\/#website","url":"https:\/\/elbsolutions.com\/projects\/","name":"ELB Solutions.com Inc.","description":"Bringing all your IT Pieces together","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elbsolutions.com\/projects\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39","name":"Etienne Bley","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","caption":"Etienne Bley"},"url":"https:\/\/elbsolutions.com\/projects\/author\/etienne-bley\/"}]}},"_links":{"self":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/comments?post=1812"}],"version-history":[{"count":2,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1812\/revisions"}],"predecessor-version":[{"id":1814,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/1812\/revisions\/1814"}],"wp:attachment":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/media?parent=1812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/categories?post=1812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/tags?post=1812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}