Hi Ruchith,
I noticed that you just resolved issue 119, which dealt with namespace
of unqualified attributes. Issue 114 (which was filed by me) is
directly related to that. It would be great if you could look at the
issue and resolve it also (I guess this is how I'm voting for the issue
I reported =) ). For your convenience, I attached a non-junit test case
to the issue.
You obviously are way more familiar with the code than I am, but I think
there may also be a bug in the addAttribute(OMAttribute) function of
OMElementImpl.java. I don't think it is correctly handling unqualified
("" namespace, "" prefix) attributes. In my local sources (Axiom
1.1.1), I have:
/**
* Inserts an attribute to this element. Implementor can decide as
to insert this
* in the front or at the end of set of attributes.
*
* @return Returns attribute.
*/
public OMAttribute addAttribute(OMAttribute attr) {
if (attributes == null) {
this.attributes = new LinkedHashMap(5);
}
OMNamespace namespace = attr.getNamespace();
if (shouldDeclareAttributeNamespace(namespace)) {
this.declareNamespace(namespace.getNamespaceURI(),
namespace.getPrefix());
}
attributes.put(attr.getQName(), attr);
return attr;
}
/**
* Do not declare namespace if namespaceURI is "" - there is no need to
* in this case.
*
* @return whether to declare the namespace or not
*/
private boolean shouldDeclareAttributeNamespace(OMNamespace namespace) {
boolean ret = false;
if (namespace != null) {
String namespaceURI = namespace.getNamespaceURI();
if (namespaceURI != null && namespaceURI.trim().length() > 0) {
ret = findNamespace(namespace.getNamespaceURI(),
namespace.getPrefix()) == null;
}
}
return ret;
}
--
Jeehong Min
Software Engineer - Service Oriented Architecture Solutions
Parasoft Corporation email: [EMAIL PROTECTED]
101 E. Huntington Ave. voice: (626) 256-3680
Monrovia, CA. 91016 fax : (626) 256-6884
"We Make Software Work"
Visit the SOAtest forum: http://forums.parasoft.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]