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] My report on experiments with unused namespaces

  On 22/09/10 10:59, Michael Kay wrote:
> A stricter view might be whether it SHOULD be used by anyone; one 
> might imagine a stronger form of canonicalization that, for example, 
> moves all namespace declarations to the outermost element, changes the 
> prefixes, and deletes namespace declarations that are not used in any 
> element or attribute names. You might take the view that people should 
> write their applications in such a way that they continue to work 
> after such a change; and others might legitimately take a different 
> view. This is in the realm of "best practice", where no two people 
> will agree.

This comes back to the original question of whether a namespace 
declaration can be considered to be unused.  The spanner in the works, 
as was mentioned in the SOAP example, is QName text content.  These are 
hateful things, speaking from experience.  Many API's try to be helpful 
wrt namespaces.  DOM supports namespace fixup on serialization.  
XMLOutputFactory (may) support javax.xml.stream.isRepairingNamespaces to 
perform a similar job.  Unfortunately all this useful stuff is rendered 
useless if you're dealing with XML that contains QName values.  I think 
the XPath 2 data model suffers from a similar problem. You're forced to 
manually ensure that the complete namespace context is maintained.

I think in an ideal world either QName would be recognised as 'special' 
in a similar way to elements and attributes by the XML data model so 
that the various XML API's could handle them gracefully.

Chris Simmons.

[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