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

Re: RE: Namespace use cases

  • From: Sean McGrath <sean.mcgrath@propylon.com>
  • To: xml-dev@lists.xml.org
  • Date: Sat, 11 Jul 2009 10:08:01 -0500

Re:  RE: Namespace use cases
On Jul 9, 2009, at 5:59 PM, Jim Tivy wrote:

 >I would love to hear of some success or horror stories of 
multi-namespaces
 >in authoring content.  Anyone out there doing this in DITA, DocBook, open
 >office...

I have nothing but horror stories about namespaces in authoring contexts and
in content transformation.

Look at the complexity of XML canonicalization and you will see
the problems that namespaces have wrought. Does serializing a
data structure so that the output is "the same" as the input really have 
to be
that complicated?

Look at the complexity of cutting and pasting lumps of XML tree 
structures with DOM or any other
XML DAG object model. Look at all the problems that namespace 
"bleed"/inheritance causes. Does
programmatic copy/paste really have to be that complicated?

Look at the complexity added to XPath/XQuery to deal with the fact that 
new namespace contexts can
come into existence anywhere in the DAG?

Look at the complexity added to tooling like Xerces/Xalan that has to 
deal with the fact that new
namespace contexts can come into existence anywhere and at any time?
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6344064)

I took a shot at identifying the problems and specifying subsets of 
XML's core bits years ago to address
the practical gotchas I was seeing using XML extensively in the real 
world. I developed them
for the Irish Government. See http://oreilly.com/pub/wlg/6659. They used 
to be online but don't seem to
be online any more however.

Anyway, I have a trick I use every day for namespaced XML processing and 
I strongly recommend it
to everyone : mask them.

Start your processing pipelines by masking the namespaces. E.g.

transform this:
    <h:table xmlns:h="http://www.w3.org/TR/html4/">

to this:
    <h_table xmlns_h="http://www.w3.org/TR/html4/">

Now, go about your business processing the data and when you are ready
to re-serialize to disk, do the transform in reverse. E.g.

transform this:
    <h_table xmlns_h="http://www.w3.org/TR/html4/">
to this:
    <h:table xmlns:h="http://www.w3.org/TR/html4/">

Obviously, I don't do it prefix by prefix. I use utilities that 
transform all prefixes and all namespace
declarations.

It works a treat:-)

Sean
http://seanmcgrath.blogspot.com



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