From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cc10950bd98eb465 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Microsoft & Ada (and also a remark on DTDs prohibiting Date: Mon, 13 Sep 2004 19:16:23 +0000 (UTC) Organization: GMUGHDU Message-ID: References: NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1095102983 9858 134.91.1.34 (13 Sep 2004 19:16:23 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Mon, 13 Sep 2004 19:16:23 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:3694 Date: 2004-09-13T19:16:23+00:00 List-Id: Robert C. Leif wrote: : DTDs have a horrible syntax. Care to elaborate? : XML schema can be constructed to have : essentially a one-to-one correspondence to Ada. In essence, Schema definitions can be more specific about a mapping of XML text to a subset of record types, enums, and some string types, if you neglect Unicode (how many Characters do you need for a 64 character Unicode String in Ada?). More advanced XML element types (for example recursive XML element types) are not that easily mapped to Ada records. : Readability and strong : typing are very useful characteristics for software engineering. Right. Which is why I prefer a clear Content Model notation, which in case of DTDs is based on well established ways of writing regular grammars. (Using: () for grouping, | for alternatives, * for any, + for at least one. Is there any Schema author who doesn't know these?) Paraphrasing definitions from you Schema files, consider This DTD definition looses the information given in the Schema that the element content must be a normalized string (IOW, a normalized attribute value...) of at least 64 Unicode characters, as per your definition of Bd_64_Type. (Is "Unfuctionalized" a typo?) But are these declarations written in a horrible syntax? I can see no significant difference of the above enumeration from type Reactive_Functionality_Num is (Unfuctionalized , mono , di , tri); On the whole I think what you have tried is to map some internal data representation 1:1 onto an external XML Schema. Good idea? : Most of the data types are NOT numeric. (OK, let me call them punch card data, as in fact there are also names and hex numbers separated by ',', and more. Nothing wrong with punch cards, if they matter.) : My Ada code employs the same data-types and names as : the XML schema. Can this be a mistake? I think there are situations where this is a mistake. It misses an opportunity to abstract from the bounds of the machines. Make a "logical" format. For example, one of your Schema types specifies hex-num-of-four-digits COMMA hex-num-of-four-digits . via [0-9a-fA-F]{4},[0-9a-fA-F]{4}. Doesn't this lend itself well to a definition that names the two hex numbers? Like in These are still Ada names, but it should be obvious what is meant even if you do not know Ada. "Pattern matching is not parsing." (SNOBOL4 saying.) regards, -- Georg