Bugs item #975410, was opened at 2004-06-18 16:56
Message generated for change (Comment added) made by maartenc
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=975410&group_id=16035

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: marc pellmann (marcpellmann)
>Assigned to: Maarten Coene (maartenc)
Summary: No Information about namespace definition element

Initial Comment:
There is no direkt information, were a namespace is
defined. If I have

<a xmlns:ns1="uri1">
  <ns1:b/>
  <ns2:c xmlns:ns2="uri2"/>
</a>

I could not get the namespace informations directly
from the elements. (The XMLWriter use the
NamespaceStack for this - but I do not have access)



----------------------------------------------------------------------

>Comment By: Maarten Coene (maartenc)
Date: 2004-06-22 13:45

Message:
Logged In: YES 
user_id=178745

I've fixed the Element.declaredNamespaces() method to only
return namespaces that were declared on that element.

In your example, this should return the following:
a -> uri1
b -> nothing
c -> uri2

I hope this solved your problem?
Maarten

----------------------------------------------------------------------

Comment By: marc pellmann (marcpellmann)
Date: 2004-06-21 12:17

Message:
Logged In: YES 
user_id=1066225

If I use additionalNamespaces() I get

<a xmlns:ns1="uri1"> --> uri1
<ns1:b/>
<ns2:c xmlns:ns2="uri2"/>
</a>

nothing at b or c

best regards, marc.

----------------------------------------------------------------------

Comment By: marc pellmann (marcpellmann)
Date: 2004-06-21 11:49

Message:
Logged In: YES 
user_id=1066225

If I use declaredNamespaces() I get the following:

<a xmlns:ns1="uri1">  --> uri1
<ns1:b/> --> uri1
<ns2:c xmlns:ns2="uri2"/> -->uri2
</a>

And what I do not want to get is the uri1 at b.

----------------------------------------------------------------------

Comment By: Maarten Coene (maartenc)
Date: 2004-06-21 10:29

Message:
Logged In: YES 
user_id=178745

ok, I see what your problem is. I think the behaviour of
Element.getDeclaredNamespaces() is incorrect: it should not
return the namespace of the element if it's not defined
(declared) in that element (for instance your b element)

----------------------------------------------------------------------

Comment By: marc pellmann (marcpellmann)
Date: 2004-06-21 10:09

Message:
Logged In: YES 
user_id=1066225

If I use additionalNamespaces() I get

<a xmlns:ns1="uri1"> --> uri1
<ns1:b/>
<ns2:c xmlns:ns2="uri2"/>
</a>

nothing at b or c

best regards, marc.

----------------------------------------------------------------------

Comment By: Maarten Coene (maartenc)
Date: 2004-06-21 10:01

Message:
Logged In: YES 
user_id=178745

And what if  you use the Element.additionalNamespaces() method?

Maarten

----------------------------------------------------------------------

Comment By: marc pellmann (marcpellmann)
Date: 2004-06-21 09:45

Message:
Logged In: YES 
user_id=1066225

If I use declaredNamespaces() I get the following:

<a xmlns:ns1="uri1">  --> uri1
<ns1:b/> --> uri1
<ns2:c xmlns:ns2="uri2"/> -->uri2
</a>

And what I do not want to get is the uri1 at b.

----------------------------------------------------------------------

Comment By: Maarten Coene (maartenc)
Date: 2004-06-18 20:19

Message:
Logged In: YES 
user_id=178745

I'm not sure what you want to do: can't you use the
Element.declaredNamespaces() method for your purpose (e.g.
to retrieve the namespace delcaration in element "a")

Maarten

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=975410&group_id=16035


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to