Click to See Complete Forum and Search --> : xml document writing


casperovo
06-04-2006, 10:55 PM
hey guys....
thanks alot for the first reply...
i have two more questions in my homework which am not finding the good solution since the teacher just gave us a quick preview and then gave us directly these question......

i will appreciate alot your help.....

Question 5
with this DTD :
<!ELEMENT cours (module*) >
<!ELEMENT module (#PCDATA) >
<!ATTLIST module nom CDATA #REQUIRED optionnel (vrai|faux) "faux">
located in « cours.dtd ».
write a documentdocument XML for describing a cours of 3 modules named:
« 1. La vie sous-marine », « 2. La vie
extraterrestre » et « 3. La vie supraterrestre ».
only the third module is optionnel.
The document XML should be valid

Orc Scorcher
06-05-2006, 05:31 AM
I don't think I should do all of your homework. How far have you come with this and what exactly don't you understand about the question?

casperovo
06-05-2006, 12:41 PM
i understand ur point...but the thing is thati have my final after the homework in two days si i was counting on it to revise my finals since the teacheer won't give us the solution...
i understand ur point!!!
Thanks anyways

Michael2003
06-05-2006, 02:42 PM
What do you think the answer should be? Do you understand any of the DTD? Do you know how to validate a document against a DTD so that you can check whether it is valid?

casperovo
06-05-2006, 03:18 PM
i wish i do...if i do understand the case i wouldn't posted the question here:S

Michael2003
06-05-2006, 03:33 PM
The DTD consists of element and attribute declarations. The first two take are element declarations which take the general form:

<!ELEMENT cours (children)>
So the first line defines a cours element with multiple module elements as children. Based on that what do you think the second line defines?

Attribute declarations take the following form:

<!ATTLIST element attrName type defaultValue>
So the second line says the the module element has an attribute called nom which contains text that is required. It then goes on to define an optionnel element, with a predefined value and one of two possible values.

Based on this can you figure out the second line and write the document yourself?

casperovo
06-05-2006, 10:12 PM
<!ELEMENT nom (coursename)>

????

casperovo
06-05-2006, 10:26 PM
micheal thanks for spending time to met me undersatnd the case
but unfortunately i stil have today and tomorow to do it and i got no time to revise my whole course...all am counting on is these solutions for the exercice to study them before the exam....
so i duno if u can really help me in this...

the exam wil come as the exercice...so once i have these solution i can study them...

i know this is not a good method of doing it but this is wut happened to me and i found my self in this situation i hope u understand and help me.....
Thanks

casperovo
06-05-2006, 10:32 PM
micheal thanks for spending time to met me undersatnd the case
but unfortunately i stil have today and tomorow to do it and i got no time to revise my whole course...all am counting on is these solutions for the exercice to study them before the exam....
so i duno if u can really help me in this...

the exam wil come as the exercice...so once i have these solution i can study them...

i know this is not a good method of doing it but this is wut happened to me and i found my self in this situation i hope u understand and help me.....
Thanks