Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9205149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:53:03+00:00 2026-06-17T23:53:03+00:00

this is getting to my brain so i have a XML doc that has

  • 0

this is getting to my brain so i have a XML doc that has a node called family

<family>
  <parents>
    <name>Bob</name>
    <init>R</init>
    <surname>Johnson</surename>
  </parents>
  <kids>
    <name>Lucy</name>
    <surname>Johnson</surname>
  </kids>
</family>

the inital is optional so i create the DTD for this it ends up looking like

<!ELEMENT parent (name, initial?, surname)>
<!ELEMENT kid (name, initial?, surname)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT initial (#PCDATA)>
<!ELEMENT surname (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT initial (#PCDATA)>
<!ELEMENT surname (#PCDATA)>

but i keep getting this error validity error : Redefinition of element name ^ /tmp/tmp.dtd:26: validity error : Redefinition of element initial ^ /tmp/tmp.dtd:27: validity error : Redefinition of element surname ^

even if i change the DTD to look like this.

<!ELEMENT parent (name, initial?, surname)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT initial (#PCDATA)>
<!ELEMENT surname (#PCDATA)>
<!ELEMENT kid (name, initial?, surname)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT initial (#PCDATA)>
<!ELEMENT surname (#PCDATA)>

same error.. this is literally the second day i am using xml and from the tutorials i have read i cant seem to see what i am doing wrong..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:53:05+00:00Added an answer on June 17, 2026 at 11:53 pm

    You don’t need to declare the name, initial and surname twice, just try

    <!ELEMENT parent (name, initial?, surname)>
    <!ELEMENT kid (name, initial?, surname)>
    <!ELEMENT name (#PCDATA)>
    <!ELEMENT initial (#PCDATA)>
    <!ELEMENT surname (#PCDATA)>
    

    parent and kid share the same definitions for their three (or two) child elements. Given an additional definition of

    <!ELEMENT family (parent*, kid*)>
    

    this would validate the following (corrected from the document you included in the question)

    <family>
      <parent>
        <name>Bob</name>
        <initial>R</initial>
        <surname>Johnson</surname>
      </parent>
      <kid>
        <name>Lucy</name>
        <surname>Johnson</surname>
      </kid>
    </family>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problems getting my brain around this. I have four models: Account has
This is getting me quite confused: I have a small application that uses a
Getting this weird LINQ error. title = System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String Here is the code I have:
I have a large XML file (180 megs or so) that has lots of
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Im getting this linker error that won't let me compile. It only happens on
I have a slide show built with jQuery that pauses on hover. It has
I nearly have this going but don't have sufficient brain power to work out
I have a list of objects, called Attributes, that, essentially, i need to do
I have to handle xml documents that are big enough (up to 1GB) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.