Re: [Saxdotnet-devel] Discussion status
Brought to you by:
jeffrafter,
kwaclaw
From: Elliotte H. <el...@me...> - 2004-12-10 11:51:43
|
Karl Waclawek wrote: > - Should GetType() potentially differentiate between "NMTOKEN" > and and enumeration? Choices: return "ENUMERATION" or the > actual list of values. One more note on this: The XML Infoset spec states: # [attribute type] An indication of the type declared for this attribute in the DTD. Legitimate values are ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS, NOTATION, CDATA, and ENUMERATION. If there is no declaration for the attribute, this property has no value. If no declaration has been read, but the [all declarations processed] property of the document information item is false (so there may be an unread declaration), then the value of this property is unknown. Applications should treat no value and unknown as equivalent to a value of CDATA. The value of this property is not affected by the validity of the attribute value. So it does distinguish between ENUMERATION and NMTOKEN. > Question: What is GetType() actually useful for? It is important to know which attributes have ID, IDREF, and IDREFS types. That has a lot of practical implication for XPath, XPointer, and other applications. ENTITY, ENTITIES, and NOTATION are also practically important in the rare use cases where someone is using unparsed entities and notations. For serialization it's sometimes useful to know whether an attribute has type CDATA or not, to support proper round-tripping. However, the distinction between ENUMERATION and NMTOKEN is pretty minimal and somewhat tautological. For instance, you need it to make XInclude work, because XInclude is defined in terms of the Infoset, but the practical impact is pretty small. I can imagine it might be useful if you were trying to derive a DTD from an instance document. -- Elliotte Rusty Harold el...@me... XML in a Nutshell 3rd Edition Just Published! http://www.cafeconleche.org/books/xian3/ http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim |