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

Re: Vocabulary Combination and optional namespaces


python vocabulary

Paul Prescod  wrote:
> Joe English wrote:
> > In addition to writing XML documents, I also write software
> > that processes those XML documents.  That's where the real
> > namespace pain begins.
>
> If you are writing software that _implements_ namespaces (e.g. a parser
> or filter or API) then I can see the problem. If you write software that
> _uses_ namespaces, I don't see it that much.

I do both.

No, wait, that's a lie: I do neither.  I write programs that
process XML, and often end up writing toolkits to make writing
those programs easier, but to date I haven't implemented XMLNS
support in anything.

> Writing an XSLT for a
> document with namespaces is not much harder than writing it for one
> without.

That's *exactly* the level of sanity I'd like to see in a
general-purpose toolkit!  With XSLT, you can declare all the
namespaces you're interested in in one place, write names as
atomic strings everywhere else (using your preferred prefixes),
and you never need to worry about in-scope namespace nodes,
namespace declarations, or decomposing or reserializing QNames,
since the processor takes care of all that for you.  The only time
things get hairy is when the source document uses QNames-in-content.

> Ditto with Python.

Perhaps.  The xml.dom module has separate "doFoo" and "doFooNS"
methods for most element and attribute-related operations;
that's a big strike against it in my book.  What happens if you do:

    someNode.appendChild(dom.createElementNS(someURI, someGI))

where 'someNode' has no in-scope namespace binding for 'someURI'?
(The documentation is unclear on this).  Does it do something
reasonable, or do you end up with an invalid DOM?

> [...]
> Now I will happily admit that there are circumstances where namespaces
> are massively painful to code around. In particular, when you are
> implementing the infrastructure.

Maybe that's my problem: I like to build infrastructure.
SAX-like and DOM-like interfaces are way too low-level for
my tastes, so I'm always building higher-level abstractions
on top of them to match the task at hand.  These are much
harder to get right when you have to worry about namespaces.


--Joe English

  jenglish@f...

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