[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Architectural Forms instead of Namespaces

  • From: James Clark <jjc@j...>
  • To: xml-dev@i...
  • Date: Sat, 24 May 1997 12:42:05 +0700

doctype xml
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@m...</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@m...</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@m...</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@m...</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@i... the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.