OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Where have the element types gone?

[ Lists Home | Date Index | Thread Index ]

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 

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

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

If I write in an instance document:


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:


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!

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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS