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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:05:07+00:00 2026-05-16T17:05:07+00:00

Among the elements that consist my xml, I have got element let’s call it

  • 0

Among the elements that consist my xml, I have got element let’s call it ‘X’ that can contain many different kind of inner elements. Therefore I’d like to define the DTD parser to avoid parsing its content during its XMl validation.
I tried to define this elemtn by:
<!ELEMENT X ANY>
and got error message that the inner element inside ‘X’ is undefined
and when trying to define it as:
<!ELEMENT X (#PCDATA)>
I got the error message ‘Only text allowed inside ‘X”

How should I define X so the DTD validator will ignore the content of element ‘X’?

  • 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-16T17:05:08+00:00Added an answer on May 16, 2026 at 5:05 pm

    Some guides on the Internet claim that ANY means shutting down the validation process for this element, but this is not correct information. Content model ANY in DTD doesn’t actually mean “allow whatever well formed XML content in this element”. Instead it means “allow any content defined in this DTD”. This means that you will get an error for every element which content model you have not defined (or you can not define). Conceptually speaking this means the same as being unable to allow contents from another namespace.

    Unfortunately at the moment I can’t recall any way to do this with DTD. However, this is possible with XML Schemas:

    <xs:complexType>
      <xs:sequence>
        <xs:any namespace="##any" processContents="skip"/>
      </xs:sequence>
    </xs:complexType>
    

    This would allow any elements from any namespace and skip the validation for this element. If you are able to switch from DTDs to XML Schemas, this would solve your problem.

    Note about a simple error when using ANY
    (Original poster didn’t have this error but I’m just mentioning it here since I’m already writing about this subject.)
    This is a simple typo to make, but these two do not mean the same:

    <!ELEMENT X  ANY  >
    <!ELEMENT X (ANY) >
    

    The first one refers to content model keyword ANY but the second one means an element with name “ANY”, and it’s the parenthesis that cause this difference.

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

Sidebar

Related Questions

I have an xml file which describes (among other things) elements with attribute values
I am coding some program that among many other operations have one that from
I have a form which among others contains text inputs that contain arithmetic data
I'm trying to create a web form that contains checkboxes, among other input elements,
I have a total of 3 pages; form elements are distributed among two pages,
I already know that if you have n elements with equal heights=fill_parent, they get
I have a service call that returns to me an IEnumerable of CustomObject, this
I have a normal WPF window, let's call it TopLevel which has a bunch
I have a view that - among other things - contains a list of
I have a small JavaScript function that (among other things) retrieves the ID of

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.