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

 


Help: OASIS Mailing Lists Help | MarkMail Help

tm-pubsubj-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: RE: [tm-pubsubj-comment] ISSUE ? Look at XML Namespaces


Title: RE: [tm-pubsubj-comment] ISSUE ? Look at XML Namespaces

I allways wanted to discuss XML namespaces (xmlns) in this area, and somehow it addresses most of our issues. Let's try to get synchronized with the major basic XML standardization a little more.

At http://www.w3.org/TR/2002/WD-xml-names11-20020403/ you will find "Namespaces in XML 1.1" W3C Working Draft 03 April 2002.

"[Definition: An XML namespace is a collection of names, identified by a URI reference [RFC2396], which are used in XML documents as element types and attribute names. ]"

This starts familiar, but xmlns serve element and attribute names, while PSI are *values* that may be assigned to an element (or attribute) of a <topic>. So one could say, we don't talk about "namespaces" but about "valuespaces", or "namespaces for values". Though xmlns have not been designed to be used with values, sometimes you do it, i.e. when referencing datatypes (such as type="xsd:string") in an XML schema. So this idea is not new.

How to use a namespace in a document?

"Names from XML namespaces may appear as qualified names, which contain a single colon, separating the name into a namespace prefix and a local part. The prefix, which is mapped to a URI reference, selects a namespace."

This reads: if we had a namespace with prefix "xtm", we would write <xtm:topic> instead of <topic>.

About namespace names (a URI reference that identifies "xtm"): "The namespace name, to serve its intended purpose, should have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists). ... However, it should be noted that ordinary URLs can be managed in such a way as to achieve these same goals."

This sounds familiar again. W3C is very tolerant here. The URI reference that serves as an identifier may be "just a name" (a URN).  May be i would prefer an "ordinary URL" in this place, such as http://topicmap.org/xtm (just a sample !). The validating parsers I know expect the namespace name to be a valid URL, pointing to an XML Schema document that declares all the names used by the document. This means: the parser processes the schema and validates the usage in the document.

The xmlns working draft contains an example:

<x xmlns:edi='http://ecommerce.org/schema'>
  <!-- the 'price' element's namespace is http://ecommerce.org/schema -->
  <edi:price units='Euro'>32.18</edi:price>
</x>

In a topicmap this could look as follows:

<xtm:topicMap xmlns:xtm='http://topicmap.org/schema'>
  <!-- the 'topic' element's namespace is http://topicmap.org/schema -->
  <xtm:topic ... >....</xtm:topic>
</xtm:topicMap>

This really works and is validated by the parser. I use something similar since month.

But this is not about PSI. Let's add a psi attribute to the sample (i know this is not xtm..., but using an attribute results in a shorter sample.)

 xtm:psi="otp:pepper"

What is "otp"? We would need something like the xmlns attribute. Let's call it psins (PSI-namespace). So the whole sample may look like:

<xtm:topicMap xmlns:xtm='http://topicmap.org/schema'
  psins:otp='http://www.oasis-open.org/committees/tm-pubsubj/docs/spp/ontopia.xml'>
  <!-- the 'topic' element's namespace is http://topicmap.org/schema -->
  <!-- the 'otp:pepper' values's namespace is ... ontopia.xml -->
  <xtm:topic xtm:psi="otp:pepper">....</xtm:topic>
</xtm:topicMap>

We wouldn't necessarily need "psins", it would work using xmlns as well.

The xmlns working draft also discusses "The Internal Structure of XML Namespaces". This reads quite interesting, but it is not applicable for PSI doc, IMO. For xmlns, the internal structure is XML schema. For PSI, the internal structure is PSI doc, still to be defined. If we want parsers to process PSI-namespaces, we should define PSI doc very well ... But remember, W3C is rather tolerant "It is not a goal that it be directly usable for retrieval of a schema (if any exists)".

This would make it easy to use existing code sets that are not formally PSI docs, like ISBN: or IATA: and many others.


Thomas Bandholtz
CM / KM Division Manager; XML Network Moderator
Competence Center Content Management
SchlumbergerSema
http://www.schlumbergersema.com

Kaltenbornweg 3
D50679 Köln / Cologne
Germany
+49 221 8299 264



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC