Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

NMTOKEN

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the deal with the NMTOKEN attribute type?
Is this simply a way of ensuring that a string in an attribute is just a single word (token) and not a sentance of words?? This is the only way I can see any use for it.
( I am thinking StringTokenizer from Java )
Just want to clear this up - thanks in advance.
Andles
 
Andles Jurgen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don,t all respond at once!!
 
Author
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Andles Jurgen:
Whats the deal with the NMTOKEN attribute type?
Is this simply a way of ensuring that a string in an attribute is just a single word (token) and not a sentance of words?? This is the only way I can see any use for it.


Not only does it have to be a single word, but it has to be a valid XML name.
( Letter | Digit | '.' | '-' | '_' | ':' )
So one way it can be used is to specify an element name as an attribute value, for instance.
<search-request tag="blockquote">To be or not to be</search-request>
Best regards,
Scott
 
Andles Jurgen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks - I kind of thought thats what it was for - just seemed too simple. Though I am kind of getting the big picture now and understanding the idea behind it.
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic