Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NMTOKEN

 
Andles Jurgen
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!!
 
Scott Duffy
Author
Ranch Hand
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic