axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srinath Perera <hemap...@gmail.com>
Subject Re: [Axis2][OM] Simpler way to get NameSpace
Date Mon, 13 Dec 2004 09:40:54 GMT
On Mon, 13 Dec 2004 14:54:36 +0600, Sanjiva Weerawarana
<sanjiva@opensource.lk> wrote:
> "Glen Daniels" <glen@thoughtcraft.com> writes:
> > 3) Map namespaces at a given OMElement:
> >
> >    void registerNamespace(String uri, String prefix)
> 
> declareNamespace(.,.)?
> 
> 
> 
> > 4) Ensure that we have a consistent view on what is a namespace
> > declaration and what is an attribute.  For this XML:
> >
> >    <foo xmlns:ns1="http://ns1" attr1="bar"/>
> >
> > EITHER:
> >
> > getAttributes() returns JUST attr1, and getAllAttributes() returns both
> > the ns1 declaration and att1
> >
> > OR:
> >
> > getAttributes() returns both attributes.
> >
> > I prefer the former.  In either case I think we should consistency check
> > attributes by noticing if they are namespace declarations when they get
> > added.  After this:
> >
> >    OMAttribute attr = new OMAttribute(new QName(XMLNS, "ns1"),
> >                                       "http://ns1");
> >    element.addAttribute(attr);
> >
> > The element should now have a new namespace mapping, and our code should
> > complain if the "ns1" prefix is already mapped in this element.
> 
> So this comes down to whether the AXIOM representation is for XML 1.0
> or XML 1.0 + Namespaces. My pref would be to say that its *only* a
> namespace aware Infoset model and *never* treat namespace declarations
> as attributes.
> 
> That means, getAttribues() only returns "attr1" and we don't have
> something called getAllAttributes().
> 
> Sanjiva.
+1 yes I too not feel good about having attributes and NS mixed,
afterall we have a one way to get attributes and one way to get NS.
Why we need more than one way to get the same things?

Mime
View raw message