Jump to content

DTD for XML


Gavin121

Recommended Posts

Hi, ive got the following task:Give the DTD for an XML representation of the following nested relational schema.Emp =(ename, ChildrenSet setof(Children), SkillsSet setof(Skills))Children =(name, Birthday)Birthday = (day, month, year)Skills = (type, ExamsSet setof(Exams))Exams = (year, city)I'm really lost on how to do this. Any help would be great. Ive read the tutorials. Just think i need some more help!Thanks!

Link to comment
Share on other sites

Hi, ive got the following task:Give the DTD for an XML representation of the following nested relational schema.Emp =(ename, ChildrenSet setof(Children), SkillsSet setof(Skills))Children =(name, Birthday)Birthday = (day, month, year)Skills = (type, ExamsSet setof(Exams))Exams = (year, city)I'm really lost on how to do this. Any help would be great. Ive read the tutorials. Just think i need some more help!Thanks!

Homework question is it?! :) You really should be able to do that just after reading the tutorial.
Link to comment
Share on other sites

Ok, this is what ive come up with:<!DOCTYPE root-element[element-delclarations]><?xml version = "1.0"?><!DOCTYPE Emp [<!ELEMENT Emp( ename, Children, Skills)><!ELEMENT ename (#PCDATA)><!ELEMENT Children(name, Birthday)><!ELEMENT name (#PCDATA)><!ELEMENT Birthday (day, month, year)><!ELEMENT day (#PCDATA)><!ELEMENT month (#PCDATA)><!ELEMENT year (#PCDATA)><!ELEMENT Skills (type, Exams)><!ELEMENT type (#PCDATA)><!ELEMENT Exams (year, city)><!ELEMENT year (#PCData)><!ELEMENT city (#PCDATA)>Is this ok? Have I done anything wrong?Thanks!

Link to comment
Share on other sites

The only wrong I see here is the first line. It has to go(be removed). What it shows is DTD's basic syntax. It's not suppose to be part of the DTD. Also, at the end of the whole code, there's the "]>" missing.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...