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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:56:05+00:00 2026-05-21T18:56:05+00:00

The value of NMTOKEN follows the same rules as XML name, except with NMTOKEN

  • 0
  1. The value of NMTOKEN follows the same rules as XML name, except with NMTOKEN any of the allowed characters can be the first character. Unlike XML string type, NMTOKEN values can’t contain any whitespace. Still I fail to see its usefulness.

    So when and why would we use NMTOKEN type instead of a string type?

  2. NMTOKENS enables us to specify several NMTOKEN values (separated by whitespace) in a single string. This type makes even less sense, since it also allows a value to contain whitespace characters, which essentially means that both NMTOKENS type and string type can hold exactly the same values.

    So when is this type useful?

  • 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-21T18:56:05+00:00Added an answer on May 21, 2026 at 6:56 pm

    NMTOKEN and NMTOKENS exist in XML Schema only for compatibility with DTDs, the predecessor of XML Schema, which had those as attributes types. DTD has few other types so those don’t stand out as redundant there.

    So use NMTOKEN and NMTOKENS when you’re converting a DTD to an XML Schema.

    Addendum: Those and other all caps types fall into the same category. They are marked in the XML Schema Rec with the text, “For compatibility NMTOKEN should be used only on attributes.”

    If they exactly fit your needs, it might be easiest to use just them, but the XML Schema way is to derive from xs:string or xs:token and constrain as needed with a pattern facet. Or, more commonly in my experience, use xs:string or xs:token as-is and call it close enough.

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

Sidebar

Related Questions

Is the return value of GetHashCode() guaranteed to be consistent assuming the same string
The value I'm trying to match to can either be a word OR it
Passing value to another xaml page can be done easily with NavigationService.Navigate(new Uri(/SecondPage.xaml?msg= +
What value can the placeholder attribute be: text, number or both?
Assign value to field at the same time with field declaration Assign value to
What value would have #414141 as #AARRGGBB and what about #52b531? How can I
The value (parameter) of ABC can be NULL. I'm struggling with how to set
myInput.value is one keystroke behind when I examine it in a keyPress event handler.
'country': Value Object or Entity in DDD? Opinions either way appreciated. And, where to
What value in the SqlDbType enumeration should I use for the numeric T-SQL data

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.