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

Re: Where have the element types gone?


xml element type
Dare Obasanjo wrote:


>>What does this mean for an application processing such a document? That
>>the application, to be as generic as possible should ignore the element
>>type to determine its behavior depending on the schema. Which means that
>>these applications are unable to process the documents without a schema.
>>
> 
> I was following your argument until I got to the above paragraph. If by
> process you mean validate then this applies to documents without a DTD as
> well since the element type declaration exists in the DTD. If you aren't
> talking about validation then I don't see why needing the schema is
> necessary for processing the document in some other manner. Or are you
> refering to documents that have both a DTD and a schema?
> 
> Can you please clarify?


Yes, sure.

Let's assume I am creating a vocabulary for book publishing and that I 
create:

1) A "pub:isbn" datatype
2) A "pub:isbn" element

and that both of them are known by the application as identifying a ISBN 
number.

If I write in an instance document:

<book>
   <pub:isbn>....</pub:isbn>
...
</book>

Then, without needing to use any schema, an application (or a human 
reader) knows without ambiguity that the content of <pub:isbn> is a ISBN 
number as defined in the namespace prefixed as "pub".

This is what I understand as the main objective of namespaces in XML and 
the distinction is done on the element type + namespace.

Now, if instead of this I define in a schema a "isbn" element in my own 
namespace (or lack of namespace) having the datatype "pub:isbn":

<xs:element name="isbn" type="pub:isbn"/>

my instance document is:

<book>
   <isbn>....</isbn>
...
</book>

and determining that the content of <isbn> is a isbn number as defined 
by the namespace prefixed as "pub" requires to process the schema.

The element type has become irrelevant (I could have used "foo" instead 
of "isbn") and it has been replaced by the W3C XML Schema datatype.

I hope this is clearer!

Eric
-- 
See you in Orlando for XML 2001.
                                     http://www.xmlconference.net/xmlusa/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------


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.