- From: Curt Arnold <CurtA@altavista.net>
- Date: Wed, 11 Aug 1999 12:02:41 -0500
- To: www-xml-schema-comments@w3.org, bob_buxton@uk.ibm.com
Implying formats or datatypes from from the locale or preferences of the author of a document to be able to interpret the document adds a substantial amount of complexity, especially when dealing with a web of linked XML documents from authors. In the british user entering a postal code example, a mixture of numbers and letters is the wrong format if the address is in the US. I think the proper way to handle that is to have distinct explicit datatypes of US, British, et al postal codes and not try to imply a format from any generic locale information. Of course, some presentation layer may present a view where the British postalcode format is the default for a British users. I'd could see something like: <elementType name="address"> <sequence> <!--- omitted classic address things ---> <elementType name="PostalCode"> <choice> <elementTypeRef name="ZipCode"/> <elementTypeRef name="UKPostCode"/> <elementTypeRef name="CAPostCode"/> </choice> </elementType> </sequence> </elementType> In the enumeration example, I wouldn't have distinct datatypes but would allow multiple literals being mapped to the same value. Either something like: <datatype name="size"> <basetype name="integer"/> <enumeration> <literal value="1">Extra Small</literal> <literal value="1">XS</literal> <literal value="1">Tres Petite</literal> .... </enumeration> </datatype> Any application would need to be able to support any of the allowed values regardless of the locale of the user or processor. It may be appropriate to indicate a generic literal and alternatives or locale specific values. <datatype name="size"> <basetype name="integer"/> <enumeration> <enumerationValue value="1"> <literal>Extra Small</literal> <literal>XS</literal> <literal locale="french locale identifier">Tres Petite</literal> </enumerationValue> .... </enumeration> </datatype> Where the first literal would be implied to be the generic and primary literal. ---------------- Documentation: I've added my own documentation elements to several of the earlier technical notes and to the working draft to support the generation of the documentation that I have needed for my internal schema development. And apparently like the SOX submission, all my documentation comments have been inline. The recent debate on the xml-dev mailing list regarding concerns about the size of schemas versus DTD and the need expressed in the previous message is inclining me to lean toward an documentation in separate elements linked to schema elements. Unfortunately in the first draft, not everything that you want to document has an explicit way to reference (for example, literals and attributes don't have an explicit id or reference mechanism that you could use to provide a detailed description of the meaning of the literal). I'd see something like: <elementType name="documentation"> <attribDecl name="locale"/> <choice> <elementTypeRef name="elementTypeRef"/> <elementTypeRef name="datatypeRef"/> <elementTypeRef name="attributeRef"/> <elementTypeRef name="literalRef"/> <!-- maybe some more --> </choice> <elementType name="description"> <!-- just straight string description --> <basetype name="string"/> </elementType> <elementType minOccur="0" name="remarks"> <!-- allow XHTML remarks --> <any/> </elementType> <!-- need some method to show examples of usage --> <choice minOccur="0"> <elementType name="exampleRef"/> <elementType name="example"/> </choice> <elementTypeRef minOccur="0" maxOccur="*" name="seeAlso"/> <elementTypeRef minOccur="0" name="documentation"/> </documentation> The schema element should then have a documentationRef element that allows linking to the documentation content. <elementType name="documentationRef"> <attrDecl name="href" required="1"> <datatypeRef name="uri"/> </attrDecl> <attrDecl name="locale"> <datatypeRef name="string"/> </attrDecl> </elementType> <elementType name="schema"> ... <choice minOccur="0" maxOccur="*"> <elementType name="documentation"/> <elementType name="documentationRef"/> <choice> </elementType> Good luck in Montreal.
Received on Wednesday, 11 August 1999 13:16:59 UTC