Hi,
i'm using the latest
released version of java security package and i think i found a small problem in
NameSpaceSymbTable.java function getUnrenderedNodes (i checked the CVS version,
it doesn't have this fixed).
In case of the
following:
<parent
xmlns="http://www.w3.org/2000/09/xmldsig#">
<Object
id="test"><a xmlns=""></a></Object>
</parent>
when
canonicalizing test uri, the namespace in a is removed since it is compared
to an empty uri which is not set when getting rendering parent namespaces. The
following helped solved the problem (adding the n.lastrendered=n.uri
line):
public
void getUnrenderedNodes(Collection result) {
//List result=new ArrayList();
Iterator it=symb.entrySet().iterator();
while (it.hasNext()) {
NameSpaceSymbEntry n=(NameSpaceSymbEntry)((Map.Entry)it.next()).getValue();
//put them rendered?
if ((!n.rendered) && (n.n!=null)) {
result.add(n.n);
n.lastrendered=n.uri;
n.rendered=true;
}
}
}
//List result=new ArrayList();
Iterator it=symb.entrySet().iterator();
while (it.hasNext()) {
NameSpaceSymbEntry n=(NameSpaceSymbEntry)((Map.Entry)it.next()).getValue();
//put them rendered?
if ((!n.rendered) && (n.n!=null)) {
result.add(n.n);
n.lastrendered=n.uri;
n.rendered=true;
}
}
}
________________________________________
Miha Vidmar
HERMES Softlab d.d., Ljubljana,
Slovenija
Tel. +386 (0)1 586 52 00
Fax. +386 (0)1 586 52 70
________________________________________