Architectural Forms instead of Namespaces

James Clark jjc at jclark.com
Sat May 24 07:58:29 BST 1997


At 18:00 23/05/97 -0700, Andrew Layman wrote:
>Several writers have suggested that architectural forms could be used to
>solve the namespaces problem.  Could someone who understands AFs rewrite
>the example below to use AFs?

If I was designing an architectural form mechanism that could work with just
instances, I would probably do it something like:

<XML>
 <?xml-arch
  arch="IDN//www.bigbookstore.com//ARCH Book Orders//EN"
  form-att="bk"
 ?>
 <?xml-arch
  arch="IDN//www.w3.org//ARCH Digital Signatures 1.0//EN"
  form-att="w3"
 ?>
  <BOOK-ORDERS BK="ORDERS">
   <?xml-arch
    arch="IDN//purl.org//ARCH Dublin Core//EN"
    form-att="dc"
   ?>
   <?xml-arch
    arch="IDN//www.shipping.com//ARCH Shipping//EN"
    form-att="sh"
   ?>
   <LINEITEM BK="LINEITEM">
    <NAME DC="NAME">Number, the Language of Science</NAME>
    <AUTHOR DC="AUTHOR">Dantzig</AUTHOR>
    <PRICE BK="PRICE">5.95</PRICE>
    <SHIPPING-ZONE SH="ZONE">9</SHIPPING-ZONE>
    <DIGITAL-SIGNATURE W3="DSIG"> 
     <DIGEST W3="DIGEST">1234567890</DIGEST>
     <SIGNER W3="DIGEST">AndrewL at microsoft.com</SIGNER>
    </DIGITAL-SIGNATURE>
   </LINEITEM>
  </BOOK-ORDERS>
</XML>

In fact I would always use a DTD subset to get something like this:

<!DOCTYPE XML [
<?xml-arch
 arch="IDN//www.bigbookstore.com//ARCH Book Orders//EN"
 form-att="bk"
?>
<?xml-arch
 arch="IDN//www.w3.org//ARCH Digital Signatures 1.0//EN"
 form-att="w3"
?>
<?xml-arch
 arch="IDN//purl.org//ARCH Dublin Core//EN"
 form-att="dc"
?>
<?xml-arch
 arch="IDN//www.shipping.com//ARCH Shipping//EN"
 form-att="sh"
?>
<!ATTLIST BOOK-ORDERS BK NAME #FIXED "ORDERS">
<!ATTLIST LINEITEM BK NAME #FIXED "ORDERS">
<!ATTLIST NAME DC NAME #FIXED "NAME">
<!ATTLIST AUTHOR DC NAME #FIXED "NAME">
<!ATTLIST PRICE DC NAME #FIXED "PRICE">
<!ATTLIST SHIPPING-ZONE SH NAME #FIXED "ZONE">
<!ATTLIST DIGITAL-SIGNATURE W3 NAME #FIXED "DSIG">
<!ATTLIST DIGEST W3 NAME #FIXED "DIGEST">
<!ATTLIST SIGNER W3 NAME #FIXED "SIGNER">
]>
<XML>
  <BOOK-ORDERS>
   <LINEITEM>
    <NAME>Number, the Language of Science</NAME>
    <AUTHOR>Dantzig</AUTHOR>
    <PRICE>5.95</PRICE>
    <SHIPPING-ZONE>9</SHIPPING-ZONE>
    <DIGITAL-SIGNATURE> 
     <DIGEST>1234567890</DIGEST>
     <SIGNER>AndrewL at microsoft.com</SIGNER>
    </DIGITAL-SIGNATURE>
   </LINEITEM>
  </BOOK-ORDERS>
</XML>

and I would also probably make use of the rules for defaulting the form
attribute so I could instead do:

<!DOCTYPE XML [
<?xml-arch
 arch="IDN//www.bigbookstore.com//ARCH Book Orders//EN"
 form-att="bk"
?>
<?xml-arch
 arch="IDN//www.w3.org//ARCH Digital Signatures 1.0//EN"
 form-att="w3"
?>
<?xml-arch
 arch="IDN//purl.org//ARCH Dublin Core//EN"
 form-att="dc"
?>
<?xml-arch
 arch="IDN//www.shipping.com//ARCH Shipping//EN"
 form-att="sh"
?>
<!ATTLIST SHIPPING-ZONE SH NAME #FIXED "ZONE">
<!ATTLIST DIGITAL-SIGNATURE W3 NAME #FIXED "DSIG">
]>
<XML>
  <BOOK-ORDERS>
   <LINEITEM>
    <NAME>Number, the Language of Science</NAME>
    <AUTHOR>Dantzig</AUTHOR>
    <PRICE>5.95</PRICE>
    <SHIPPING-ZONE>9</SHIPPING-ZONE>
    <DIGITAL-SIGNATURE> 
     <DIGEST>1234567890</DIGEST>
     <SIGNER>AndrewL at microsoft.com</SIGNER>
    </DIGITAL-SIGNATURE>
   </LINEITEM>
  </BOOK-ORDERS>
</XML>

Finally I would probably put the DTD in a separate file:

<!DOCTYPE XML SYSTEM "http://www.jclark.com/dtds/book-order.dtd">
<XML>
  <BOOK-ORDERS>
   <LINEITEM>
    <NAME>Number, the Language of Science</NAME>
    <AUTHOR>Dantzig</AUTHOR>
    <PRICE>5.95</PRICE>
    <SHIPPING-ZONE>9</SHIPPING-ZONE>
    <DIGITAL-SIGNATURE> 
     <DIGEST>1234567890</DIGEST>
     <SIGNER>AndrewL at microsoft.com</SIGNER>
    </DIGITAL-SIGNATURE>
   </LINEITEM>
  </BOOK-ORDERS>
</XML>

James




xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa at ic.ac.uk)




More information about the Xml-dev mailing list