Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers

ArticlesXML Namespaces


March 1998 / Cover Story / Weaving a Better Web / XML Namespaces

We make a big deal out of the fact that XML describes data, not presentation information. But what good are data descriptions if you are the only one who describes a particular kind of data that way? XML allows authors to invent new element names and publish them for others to use and thus agree upon standard terms for common data elements. These published namespace s prevent name conflicts and indicate who defined a term. They also will make the work of search engines easier, as tags become more meaningful.

A name begins with a letter or one of a few punctuation characters, and continues with name characters, which include letters, digits, underscores, hyphens, colons, and periods. Names beginning with the string xml are reserved. Here's an example of some XM L that calls two defined data description namespaces -- one for an order, one for a digital signature (such as a VeriSign signature):

<xml>
<xml:schema>
<namespaceDcl href="http://www.company.com" name="co"/>
<namespaceDcl href="http://www.dsig.org" name="dsig"/>
</xml:schema>
<xml:data>
<ORDER>
<SOLD-TO>
<PERSON><LASTNAME>Layman</LASTNAME>
<FIRSTNAME>Andrew</FIRSTNAME>
</PERSON>
</SOLD-TO>
<SOLD-ON>19970317</SOLD-ON>
<dsig:DIGITAL-SIGNATURE>1234567890</dsig:DIGITAL-SIGNATURE>
<ORDER>
</xml:data>
</xml>

An author can also specify an element's data type and format. A lextype attribute can be used for this purpose:

<SOLD-ON lextype="DATE-ISO8061">19970317</SOLD-ON>

"DATE-ISO8061" specifies that SOLD-ON contains a date in the format specified by ISO 8061. Authors can design their own data types and use public types. Microsoft is working with the World Wide Web Consortium to define a set of standard types and will publish a list that anyone can freely use.


Up to the Cover Story section contentsGo to previous article: XML NamespacesGo to next article: Creating XML Objects
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network