XML
-
What are the required elements of XML file?
Does the XML have any predefined tags?
Does the XML have any predefined entities?
How to define a comment?
Is the XML platform dependent?
What is a CDATA section in XML file?
What is the meaning of the colon within tag name?
Simple hierarchy
Using some text editor, define a relation that describes your faculty:
Your XML file should contain information about: name_of_the_faculty, group_id, id_of_the_starosts, firstname, lastname, date_of_birth (day, month, year) address, and more…
Try to use your own markup and hierarchy.
<faculty name="air">
<group id="1" starosts="222222">
<members>
<student id="222222">
<fname>Jan</fname>
<lname>Kowalski</lname>
<address>
<city>Krakow</city>
</address>
</student>
<student id="222223">
<fname>Zbigniew</fname>
<lname>Nowak</lname>
<address>
<city>Wadowice</city>
</address>
</student>
</members>
</group>
</faculty>
Define at least:
two different groups,
for each group define at least five members,
for each group define the id attribute that contains the id of the starosts.
Your file contains some structured information.
Is it possible to change the structure of your XML into another, which contains the same information.
What is an empty element?
DTD vs. XSD
DTD
XSD
Using text editor, try to define a XSD definition for your XML syntax.
Test your XML against defined XSD using:
-
-
using
xmlstarlet command:
xmlstarlet -e -s file.xsd file.xml
XPath
-
-
Using your XML try to:
find the lastnames of all students,
find all lastnames of members from your group,
find an address of the second member from your group,
find the all cities of all members,
find the all students which are older/younger than you,
find a lastname of your group starosts.
Summary
What is the DTD?
What is the XSD?
Which language (DTD or XSD) is more expressive?
What are the drawbacks of DTD in comparison with XSD?
How to define an empty element in DTD and XSD?
What is the XPath?
Does the XPath allow for nested queries?
Uwagi
Komentarze
Z braku lepszego miejsca tutaj studenci wpisują komentarze natury ogólnej do tego lab.