DTD / xmerl_scan:file help !!!!! {invalid_nmtoken,"*) #RE"

Richard A. O'Keefe ok@REDACTED
Thu Jul 14 00:55:04 CEST 2005


	changing it to
	<!ATTLIST key
	       no (1|2|3|4|5|6|7|8|9|z|r|c|astric) #REQUIRED>
	will sort the problem.
	
Except that the word is "asterisk".

	Since the mobile phone has the * (astric) key,

What has this to do with your problem?
Neither my current mobile phone nor my previous one
has any key labelled "z" or "r" or "c",
and while Unicode _does_ have a phone symbol,
there doesn't seem to be any way to represent
"red phone handset" or "green phone handset" in Unicode.

	it is interesting to know how to express the constraint as we like.
You can't.

	Could you please guide me to some reference materials or some better
	examples to pick this quickly.

Read the XML specification.
It's all on-line, it's all free.
http://www.w3.org
look at the alphabetic list of topics down the left edge (it's a long one).

	is it not possile to define a datatype like below ???
	
	<!ATTLIST fax
	      no MyType #IMPLIED>
	
	MyType::= #x9 | #xA | #xD
	
Not in a DTD, no.  You _can_ define data types in XML Schemas.
(The Schema specification is available from the W3 web site also.)

	Or using <!ENTITY like ...
	
	<!ENTITY aa "&#xD;&#xA;">
	<!ENTITY ss     "*">
	
Entities are simple parameterless unconditional string replacement macros.

	As I never did it before, I don't know how this can be done.
	
All that is involved is shifting the checking from the XML parser to
your program that walks the parse tree.

Wrox Press and O'Reilly have plenty of good books about XML.



More information about the erlang-questions mailing list