XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Pragmatic namespaces

Original Message From: "Micah Dubinko"

> A set of "using" declarations could also work like the relatively well- 
> known concept of DNS search domains.

Mentioning DNS gave me food for thought.  Here's a proposal that has a hint 
of DNS and perhaps a hint of e-mail address resolution.

1) fully qualified names should have the form:

    local_name:namespace

2) A name without a namespace belongs to the namespace of the elements 
nearest ancestor that does have a namespace.

3) A name can also be specified using a partial namespace, e.g.:

    local_name:partial_namespace

4) Unless a name ends with a . or :, on encountering a (possibly) partial 
namespace, a search is made to see if an ancestor element has a namespace 
that starts with that partial namespace.  If one is found, the namespace 
becomes that of the full namespace.  For example, if an ancestor element has 
the name:

    myName:proposal.example.com

then a name of:

    anotherName:proposal

is treated as:

    anotherName:proposal.example.com

If 'proposal' really is the full namespace, and an ancestor has a namespace 
of 'proposal.example.com' then you can prevent the expansion by doing:

    anotherName:proposal.

Trailing .s and :s are obviously removed when selecting the namespace part.

5) For the purposes of HTML5, the HTML5 namespace can be considered to be 
in-scope prior to the start of parsing so that documents can start simply 
as:

    <html ...

By way of example:

<html>
    <head>
        <root:myExtension.example.com>
            <child>
                <html:html>
                    <body>
                        <extra:myExtension/>
                    </body>
                </html:html>
            </child>
        </root:myExtension.example.com>
    </head>
    ...
</html>

- The outer 'html', and 'head' are part of the HTML5 namespace, which is 
assumed to be something like 'html.w3c.org'.

- The full name of 'child' is 'child:myExtension.example.com'.

- The 'html:html' takes us back to the HTML namespace, and so 'body' is part 
of the HTML namespace.

- 'extra:myExtension' is treated as 'extra:myExtension.example.com'.

I think this is simple and allows brevity without having to remember a lot 
of syntax.  It puts the burden on the tools rather than on the document 
authors.

Regards,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info




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


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS