• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Practice exam

 
david Bodus
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Visit www.witscale.com. Offers XML exams (40 Questions).
I hope this helps.
-Dave
 
Hema Menon
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "XML Mock Exams Link"
http://www.javaranch.com/xml/XMLexamList.jsp
needs to be updated to add this info.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pointed noted.
 
Chandra A Sekhar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
First of all thanks for the link !, One of the question here says we cannt define that elements can appear in any order using DTD semantics ( the question says we can do that only with Scema's ) . Is this true I vaguely remember I did that using DTD in one of my early projects but now I forgot ! anyone has a better Idea about it ? Can we define that elements can appear in any order using DTD ?
Thanks in advance for any input
Chandra
 
Syed AliRaza Zaidi
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Chandra ,
You can not define elemnts in any series using DTD it should be proper in sequence as state by all books but i found this query also as on Page Number 320 of Beginning XML is given example with out sequence check it out.
 
Chandra A Sekhar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Syed,
Thanks for explanation and reply, but I dont have that book with me to refer, however I could get that code Iam talking about .

*************************************************

*************************************************
Ok this is part of the DTD I designed , and we have xml instances which are validated against this DTD using XERCES. Here Topic can contain UNIT,any of the peripheralitems or QUIz in any order . Just now I again tried by giving random order of elements Xerces validates the document and as does Turbo Extensibility.
Iam not sure about the exact rules , but I think by this way we can define that elements can appear in any order.
Any DTD guru's around here who can thro some light on this topic ?
Thanks in advance
Chandra
 
Syed AliRaza Zaidi
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandra A Shekar,
According to W3C Recommendation DTD Must be in sequence but there is one possiblity of not being in order what i think that is if the document element is declared at last and its sub elements previously as it can contain sequence or list format for elements.
Bye Hope its clear.
 
david Bodus
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandra,
I think that your DTD declaration
<!ELEMENT TOPIC (TITLE , DESCRIPTION? , (UNIT | %PERIPHERALITEM; | QUIZ)*)>
interpretes that Topic can have any number of either UNIT or PERIPHERALITEM or QUIZ under TOPIC. But they must come after TITLE and DESCRIPTION.
In other words, the following XML document is not valid..
<!DOCTYPE TOPIC [
<!ELEMENT TOPIC (UNIT | QUIZ)>
<!ELEMENT UNIT (#PCDATA)>
<!ELEMENT QUIZ (#PCDATA)>
]>
<TOPIC>
<UNIT/>
<QUIZ/>
</TOPIC>

You can either have UNIT or QUIZ but not both. This is what the declaration <!ELEMENT TOPIC (UNIT | QUIZ)> means.

I hope this helps.
-david
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic