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

Re: Pragmatic namespaces

  • From: "Pete Cordell" <petexmldev@codalogic.com>
  • To: "Micah Dubinko" <Micah.Dubinko@marklogic.com>
  • Date: Wed, 5 Aug 2009 11:17:23 +0100

Re:  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]


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-2011 All Rights Reserved.