INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

xml/dtd, would this be right?

xml/dtd, would this be right?

(OP)
hello

i need to create an XML file and convert it to DTD (or viceversa)

I did this:


<!ELEMENT Arbolgenealogico (Familia+) >
<!ELEMENT (Primos+,Abuelos,Primossegundos?,Tios*)>
<!ELEMENT Primos (Nombre,Apellido,FechaNac,Edad)>
<!ELEMENT Nombre (#PCDATA)>
<!ELEMENT Apellido (#PCDATA)>
<!ELEMENT FechaNac (#PCDATA)>
<!ELEMENT Edad (#PCDATA)>
<!ELEMENT Abuelos (Nombre,Apellido,FechaNac,Edad)>
<!ELEMENT Nombre (#PCDATA)>
<!ELEMENT Apellido (#PCDATA)>
<!ELEMENT FechaNac (#PCDATA)>
<!ELEMENT Edad (#PCDATA)>
<!ELEMENT Tios (Nombre,Apellido,FechaNac,Edad)>
<!ELEMENT Nombre (#PCDATA)>
<!ELEMENT Apellido (#PCDATA)>
<!ELEMENT FechaNac (#PCDATA)>
<!ELEMENT Edad (#PCDATA)>

<!ATTLIST Primos Rama CDATA #REQUIRED>



<Arbolgenealogico>
<Familia>
<Primos Rama="Materna">
<Nombre>Ana</Nombre>
<Apellido>Velez</Apellido>
<Fechanac>27/06/1990</Fechanac>
<Edad>22</Edad>
</Primos>
<Primos Rama="Materna">
<Nombre>Sandra</Nombre>
<Apellido>Velez</Apellido>
<Fechanac>22/04/1985</Fechanac>
<Edad>27</Edad>
</Primos>

<Abuelos>
<Abuela>
<Nombre>Antonia</Nombre>
<Apellido>Velez</Apellido>
<Fechanac>22/05/1930</Fechanac>
<Edad>82</Edad>
</Abuela>
<Tios>
<Tio>
<Nombre>Manolo</Nombre>
<Apellido>Velez</Apellido>
<Fechanac>11/02/1960</Fechanac>
<Edad>52</Edad>
</Tio>
</Arbolgenealogico>



You think its right???

RE: xml/dtd, would this be right?

First of all, you cannot "convert" XML to DTD, as they are different things. You can take a look at this or aquĆ­.

Second, your XML is not valid, as you can check here. You can also validate your XML against the schema.

Cheers,
Dian

RE: xml/dtd, would this be right?

(OP)
Thank you for your answer. But what i meant is you have to "translate" a dtd into xml...

just like for example i found an example of an schema and i want to translate it into xml :p

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close