Extensible Markup Language
An Introduction |
Prof. David Bernstein |
Computer Science Department |
bernstdh@jmu.edu |
<?xml version="1.0"?> <GRADES> <STUDENT> <NAME>Kim Maschino</NAME> <ID>321-00-0021</ID> <GRADE>A+</GRADE> </STUDENT> <STUDENT> <NAME>Doug Sideler</NAME> <ID>001-31-9998</ID> <GRADE>B</GRADE> </STUDENT> <STUDENT> <NAME>Wayne Tromer</NAME> <ID>100-23-4167</ID> <GRADE>C</GRADE> </STUDENT> </GRADES>
Imagine that you had developed an accounts payable database that contained the following:
<?xml version="1.0"?> <payments> <payment> <amount>21.35</amount> <check bank="157-1" >150</check> </payment> </payments>
Also, imagine someone at another organization developed a testing database that included the following:
<?xml version="1.0"?> <testing> <validation> <check location="store"> <checker>Mary Jones</checker> </check> </validation> </testing>
What problem would arise if you wanted to combine the two systems so that payments could be validated?
xmlns
attributexmlns
attribute and all of its children
<?xml version="1.0"?> <syllabus xmlns="http://www.cs.jmu.edu/users/bernstdh/"> <header> <coursename>Introduction to XML</coursename> <coursenumber>CS000</coursenumber> </header> <body> <title>Course Overview</title> </body> </syllabus>
coursename
and coursenumber
Elements<?xml version="1.0"?> <syllabus xmlns:dhb="http://www.cs.jmu.edu/users/bernstdh/"> <dhb:header> <coursename>Introduction to XML</coursename> <coursenumber>CS000</coursenumber> </dhb:header> <dhb:body> <dhb:title>Course Overview</dhb:title> </dhb:body> </dhb:syllabus>