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 6253529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:00:55+00:00 2026-05-24T14:00:55+00:00

I am new to XML and DTD. I have written an XML file with

  • 0

I am new to XML and DTD. I have written an XML file with DTD. Here is it.

<?xml version="1.0"?>
<!DOCTYPE  note[
     <!ELEMENT note (page , author ,company)>
     <!ELEMENT page (#PCDATA)>
     <!ELEMENT author (#PCDATA)>
     <!ELEMENT company (#PCDATA)>
     <!ATTLIST note type CDATA #IMPLIED>
]>

<note typ="single">
    <page>1000</page>
    <author>devan</author>
    <author>devan</author>
    <company>IDM</company>
</note>

It works fine. But my problem is, if you set the note attribute as typ it displays the result in the web browser just fine. But in the DTD it defines <!ATTLIST note type CDATA #IMPLIED>.

And whenever I change the tags in xml <pag>fhdh </pag> it displays in the web browser just fine.
My problem is then why do we define DTD?

  • 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-05-24T14:00:56+00:00Added an answer on May 24, 2026 at 2:00 pm

    DTD by itself only defines what a valid XML looks like.

    If you run the sample XML in the question through an XML validator, it will not be considered valid for the DTD you specified in the question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XML file: <?xml version=1.0?> <!DOCTYPE library SYSTEM library.dtd> <library xmlns=http://example.com/a
I have the following xml snippet: <?xml version=1.0 encoding=UTF-8 ?> <!DOCTYPE sqlMap PUBLIC -//ibatis.apache.org//DTD
I have this html doc: <?xml version=1.0 encoding=utf-8?><!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
I have looked at many examples for validating an XML file against a DTD,
I have this SVG file: <?xml version=1.0 encoding=utf-8?> <!-- Generator: Adobe Illustrator 15.0.0, SVG
I have created an XML file and DTD which can be found at the
I've created a new .xml file in my layout folder called log.xml . It
I'm creating a new XML File out of a table. The problem is I
still new to XML parsing with the iphone so i have a few questions.
I am new to xml and android programming.Here is my xml code... I don't

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.