XML-data and SGML

> From: Jean Paoli <jeanpa@microsoft.com>
  
> I am pleased to present XML-Data, a Position Paper from Microsoft.
> XML-Data is an application of XML for exchanging 
> structured data and metadata on the Internet. 
 

Here are the xml-data SCHEMA examples, expressed as usual SGML 
declarations: if the argument that you need XML-data because
you cannot do schemas, type-extension and schema-extension in
SGML, then I think you may be wrong, at least as far as the
examples.  

I may be wrong here, of course, because I have not 
gone through all the paper to see what else xml-data does in 
addition, but the SGML declarations seem far clearer than using
element tags. There can be good reasons to reinvent the wheel,
sometimes of course.

------------------------------------------ 
First, your schema is equivalent to the SGML declarations.
If you can build all the smarts to use your schema
conventions, there is only a small step to using standard
syntax.

   <!-- Here are all the element types, their contents,
       attributes and relations. -->
<!ELEMENT ORDER (SOLD-TO, SOLD-ON, ITEM* )>
  
<!ELEMENT SOLD-TO ( PERSON+ )>

<!ELEMENT SOLD-ON  (#PCDATA)>  
<!ATTLIST SOLD-ON
     lextype CDATA "DATE.ISO8061" #FIXED>  

<!ELEMENT PERSON ( LASTNAME, FIRSTNAME )"> 

<!ELEMENT LASTNAME (#PCDATA)>

<!ELEMENT FIRSTNAME (#PCDATA)>

<!ELEMENT PRICE (#PCDATA)> 

<!ELEMENT ITEM (PRICE, (BOOK | RECORD | COFFEE))>
  
<!ELEMENT BOOK (TITLE, AUTHOR)>
  
<!ELEMENT RECORD ( TITLE | ARTIST )>

<!ELEMENT SIZE  (#PCDATA)>

<!ELEMENT STYLE  (#PCDATA)>
 
<!ELEMENT COFFEE (SIZE, STYLE)>
 
<!ELEMENT TITLE  ( #PCDATA | COMPOSER )*>

<!ELEMENT AUTHOR  (#PCDATA)>

<!ELEMENT ARTIST  (#PCDATA)> 
   
<!ELEMENT COMPOSER (#PCDATA)>

-----------------------------------------------
To get the type extensability, use PEs. E.g  

<!ENTITY % artistic-work "TITLE">
<!ELEMENT artistic-work ( %artistic-work; )>

<!ENTITY % BOOK  ( %artistic-work;, AUTHOR )>
<!ELEMENT BOOK ( %BOOK; )>


----------------------------------------------
To get schema extensibility, in the original have:

<!ENTITY % order-extension "">
<!ENTITY % order " sold-to, sold-on ">
<!ELEMENT order ( %order;, %order-extension; )>

and in the prolog:

<!ENTITY % order-extension " item* ">

 

Rick Jelliffe

Received on Monday, 23 June 1997 12:33:47 UTC