add solutions for excercise 3

This commit is contained in:
Andreas Zweili 2017-05-08 22:04:25 +02:00
parent e04c8669f6
commit 4f7bca6860
2 changed files with 42 additions and 0 deletions

25
web/2_sem/xml/recipes.dtd Normal file
View File

@ -0,0 +1,25 @@
<!ELEMENT collection (description,recipe*)>
<!ELEMENT description ANY>
<!ELEMENT recipe (title,ingredient*,preparation,comment?,nutrition)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT ingredient EMPTY>
<!ATTLIST ingredient name CDATA #REQUIRED
amount CDATA #IMPLIED
unit CDATA #IMPLIED>
<!ELEMENT preparation (step*)>
<!ELEMENT step (#PCDATA)>
<!ELEMENT comment (#PCDATA)>
<!ELEMENT nutrition EMPTY>
<!ATTLIST nutrition protein CDATA #REQUIRED
carbohydrates CDATA #REQUIRED
fat CDATA #REQUIRED
calories CDATA #REQUIRED
alcohol CDATA #IMPLIED>

17
web/2_sem/xml/recipes.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE collection SYSTEM 'recipes.dtd'>
<collection>
<description>Dies ist ein Rezept für etwas zu bauen.</description>
<recipe>
<title>Brot</title>
<ingredient name="wasser" amount="2" unit="liter"/>
<ingredient name="mehl" amount="2" unit="kg"/>
<preparation>
<step>rühren</step>
<step>knetten</step>
<step>backen</step>
</preparation>
<comment>Dies ist ein Kommentar</comment>
<nutrition protein="2" carbohydrates="4" fat="7" calories="2000" alcohol="40"/>
</recipe>
</collection>