XML tutorial examples

Basic concept: Basic XML structure example

Example with XSLT and CSS styling using inline styles

The styleInline.xml file has the text values. styleInline.xml <?xml version="1.0" encoding="UTF-8"?>...

Basic XML structure example

<?xml version="1.0"?> <!DOCTYPE earth SYSTEM "ea...

Example of Processing Instructions in XML

1. <?xml-stylesheet href=”countryAreaStyle.css” type=”text/css” ?> 2. <?Country mapping?>

Example of a valid XML namespace

<root xmlns:ch11="http://www.xmlLearning.com/chapter11"> <ch11:namespace> <ch11:valid>This is valid</ch11:valid>

Example of well-formed XML elements

<earth>           <country><b>Russia</b></country>     &nbs...

Example of non-well-formed XML elements

<earth>           <country><b>Russia</country></b> -> Elements not nested properly

Example of well-formed XML attributes

<earth totalArea="100"> </earth>   <div class=”style1 style2”> </div>

Example of non well-formed XML attributes

<earth totalArea="100" population=”100”> </earth>

Example of well-formed XML comments

<earth>       <!-- Contains information on countries -->       <country>Canada</cou...