[Dev] Proposal: simplify parcel XML namespaces
Alec Flett
alecf at osafoundation.org
Mon Jun 27 09:53:37 PDT 2005
Wait, before we go any further trying to make xml namespaces work, I
have a suggestion:
Phillip J. Eby wrote:
>
> Then we should get rid of XML namespaces altogether here; parcel
> namespaces are *not* globally unique and never have been; repository
> paths and Python package namespace requirements prevent them from
> being globally unique.
>
+1 to removing all XML namespaces altogether, and here's a brainstorm
about how to do it We use them inappropriately anyway.
Their most basic use (just for everyone's review) is to allow you to
references items in other parcels. They allow me to say
xmlns:foo="..../foo"
<fooval itemref="foo:bar"/>
<foo:someKind...>
This is broken because "foo:bar" is a part of the data, not the
structure of the document. Thinking about just solving the first case,
it would be trivial to, instead of using namespaces, do something like:
<parcel...>
<parcelref prefix="foo" parcelpath="osaf.framework...."/>
...
</parcel>
because those itemref's dont' need XML namespaces to work.
The trick would be the 2nd case, where we use <foo:someKind> to refer to
a Kind. So what we really need is a way to map Tags => Kinds.
I did a search to figure out how & when we use <foo:sometag> and found:
- 20 non-test parcel.xml files use it
- the biggest consumers are:
- osaf/framework/attributeEditors/parcel.xml
- osaf/framework/blocks/parcel.xml
- osaf/framework/certstore/data/parcel.xml
- osaf/views/main/parcel.xml
- uses seem to be evenly distributed between:
- content model references - core:Integer,
contentModel:ItemCollection and the like
- "local" references, i.e. where we say xmlns:docSchema="...this
file ..."
- a few random external types like wakeupcaller:WakeupCaller
I haven't done the analysis, but I wonder how many of these files
reference more than one namespace using the ":" notation in a given
file? Perhaps if we could come up with a way of doing a "default" parcel
tag, we could eliminate the namespaces in 99% of the cases.
For example, using <parcelpath> from above:
<parcelref prefix="foo" default="true" parcelpath="...">
This might mean "for all future tags in this document, look up the Kind
in this parcelpath."
I haven't completely flushed out this idea, but anyone else have any
thoughts or other approaches to removing the need for <foo:someKind> ?
Alec
>
>> Yes, by using "parcel:" instead of "http:", you're avoiding conflicts
>> with other http URIs, but introducing the potential for conflict
>> (however unlikely) with someone else who arbitrarily breaks the same
>> rule and picks "parcel:".
>
>
> I'm curious about what use cases will be satisfied by introducing
> non-Chandler XML namespaces into a parcel.xml document. I can't rule
> out such a possibility entirely, of course, but I haven't been able to
> come up with anything that makes any sense right now.
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "Dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/dev
>
More information about the Dev
mailing list