{"id":2686,"date":"2024-02-01T15:50:48","date_gmt":"2024-02-01T15:50:48","guid":{"rendered":"https:\/\/codeinsightacademy.com\/blog\/?p=2686"},"modified":"2024-02-25T05:40:02","modified_gmt":"2024-02-25T05:40:02","slug":"xml","status":"publish","type":"post","link":"https:\/\/codeinsightacademy.com\/blog\/c-programming\/xml\/","title":{"rendered":"XML"},"content":{"rendered":"\n<p>users.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;!DOCTYPE users&gt;\n&lt;?xml-stylesheet type=\"text\/xsl\" href=\"users.xslt\"?&gt;\n&lt;users&gt;\n  &lt;user&gt;\n    &lt;name&gt;John Doe&lt;\/name&gt;\n    &lt;age&gt;26&lt;\/age&gt;\n    &lt;city&gt;New York&lt;\/city&gt;\n  &lt;\/user&gt;\n  &lt;user&gt;\n    &lt;name&gt;Alice Smith&lt;\/name&gt;\n    &lt;age&gt;25&lt;\/age&gt;\n    &lt;city&gt;Los Angeles&lt;\/city&gt;\n  &lt;\/user&gt;\n  &lt;user&gt;\n    &lt;name&gt;Pintu&lt;\/name&gt;\n    &lt;age&gt;23&lt;\/age&gt;\n    &lt;city&gt;Mumbai&lt;\/city&gt;\n  &lt;\/user&gt;\n&lt;\/users&gt;\n<\/code><\/pre>\n\n\n\n<p>users.xslt<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http:\/\/www.w3.org\/1999\/XSL\/Transform\"&gt;\n  &lt;xsl:output method=\"html\" indent=\"yes\"\/&gt;\n\n  &lt;xsl:template match=\"\/users\"&gt;\n    &lt;html&gt;\n      &lt;head&gt;\n        &lt;title&gt;User Information&lt;\/title&gt;\n      &lt;\/head&gt;\n      &lt;body&gt;\n        &lt;h2&gt;User Information&lt;\/h2&gt;\n        &lt;table border=\"1\"&gt;\n          &lt;tr&gt;\n            &lt;th&gt;Name&lt;\/th&gt;\n            &lt;th&gt;Age&lt;\/th&gt;\n            &lt;th&gt;City&lt;\/th&gt;\n          &lt;\/tr&gt;\n          &lt;xsl:for-each select=\"user\"&gt;\n            &lt;tr&gt;\n              &lt;td&gt;&lt;xsl:value-of select=\"name\"\/&gt;&lt;\/td&gt;\n              &lt;td&gt;&lt;xsl:value-of select=\"age\"\/&gt;&lt;\/td&gt;\n              &lt;td&gt;&lt;xsl:value-of select=\"city\"\/&gt;&lt;\/td&gt;\n            &lt;\/tr&gt;\n          &lt;\/xsl:for-each&gt;\n        &lt;\/table&gt;\n      &lt;\/body&gt;\n    &lt;\/html&gt;\n  &lt;\/xsl:template&gt;\n&lt;\/xsl:stylesheet&gt;\n<\/code><\/pre>\n\n\n\n<h2>POC<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2024\/02\/image-1.png\"><img loading=\"lazy\" width=\"1276\" height=\"690\" src=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2024\/02\/image-1.png\" alt=\"\" class=\"wp-image-2701\"\/><\/a><figcaption>Run xml file on VSCode Live Server<\/figcaption><\/figure>\n\n\n\n<h2>Assignment<\/h2>\n\n\n\n<p>Remove city and use address with children city and state and then show same in html table <\/p>\n","protected":false},"excerpt":{"rendered":"<p>users.xml users.xslt POC Assignment Remove city and use address with children city and state and then show same in html table<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/2686"}],"collection":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/comments?post=2686"}],"version-history":[{"count":4,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/2686\/revisions"}],"predecessor-version":[{"id":2705,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/2686\/revisions\/2705"}],"wp:attachment":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/media?parent=2686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/categories?post=2686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/tags?post=2686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}