HTML5

xml inserted

Joost van Meeteren


Links

W3C - XML Tutorial.


Example

XML 1.0 | Insertion by JavaScript


Source code

XML 1.0 ( | Insertion by JavaScript )


<xml> example in HTML5:

<script>
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","../html5/xml_and_css.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML; 

document.write("<section class=\"webdevelopment\">");
var x=xmlDoc.getElementsByTagName("webdevelopment");
for (i=0;i<x.length;i++)
  { 
  document.write("<p class=\"header_one\">");
  document.write(x[i].getElementsByTagName("header_one")[0].childNodes[0].nodeValue);
  document.write("</p>");
  document.write("<p class=\"header_two\">");
  document.write(x[i].getElementsByTagName("header_two")[0].childNodes[0].nodeValue);
  document.write("</p>");
  document.write("<p class=\"header_three\">");
  document.write(x[i].getElementsByTagName("header_three")[0].childNodes[0].nodeValue);
  document.write("</p>");
  document.write("<p class=\"xml\">");
  document.write(x[i].getElementsByTagName("xml")[0].childNodes[0].nodeValue);
  document.write("</p>");
  }
document.write("</section>");
</script>


XML 1.0 document:

<?xml version="1.0" encoding="utf-8"?>

<?xml-stylesheet type="text/css" href="../sgml/xml_and_css.css"?>

<webdevelopment>
<header_one>Joost De WebMaker</header_one>
<header_two>Joost van Meeteren</header_two>
<header_three>Ik ben Joost van Meeteren en onderzoekend. De WebMaker + De BeeldMaker + De TekstMaker = De Creatieve Maker | 2024</header_three>
<xml>This page is developed in XML 1.0, using a CSS stylesheet.</xml>
</webdevelopment>


Document

XML 1.0

See original XML with CSS example.


Joost De WebMaker
2002-2024 © Joost van Meeteren
Laatste update website: donderdag 21 november 2024