Making a Valid DTD - XML



I am trying to create a DTD in the following Exercise I found online, However I am a little stuck on Whether or not this is right.


Any help Would be appreciated:


Task: enter image description here What I have Done:



<?xml version="1.0" ecnoding="UTF-8"?>
<!DOCTYPE sale [

<!ELEMENT sale (client)>
<!ELEMENT client (address, phone, email)>
<!ELEMENT address (#PCDATA) #REQUIRED>
<!ELEMENT phone (#PCDATA) #REQUIRED>
<!ELEMENT email (#PCDATA) #REQUIRED>

<!ATTLIST sale pid (#PCDATA) #REQUIRED>
<!ATTLIST sale quantity (#PCDATA) #REQUIRED>

<!ATTLIST client name (#PCDATA) #REQUIRED>
<!ATTLIST client nin (#PCDATA) #REQUIRED>
]>

<sale>
<client>
<address>17 fdas house</address>
<phone>023423424324</phone>
<email>something@gmail.com</email>
<sale pid="heello" quantity="1"/>
<client name="A" nin="1231212312"/>
</client>
</sale>

No comments:

Post a Comment