Hi
On 23/05/14 00:14, Lou Marco wrote:

(Please forgive me if this is the wrong place for this)

Class QNamesMap has a private member QName[] values.
In the class' get method,  if it finds a QName whose NamespaceURI
matches the NamespaceURI of the passed argument but whose LocalPart
doesn't match, it evaluates a conditional expression whose Boolean is
"*".equals(values[i]).  But the elements of values[] are QNames, so
won't this always evaluate as FALSE?


QName can actually hold a "*" value only.

For example, you can have a transform entry

"{http://bar}*":"*";

This means: have all elements qualified with the "http://bar"; namespace unqualified.

Suppose you have an xml like this:

<ns:key xmlns:ns="http://bar"/>

QNamesMap will be checked if it has a key that matches  "{http://bar}key";.

We have the "{http://bar}*"; key so yes it matches, the question next is what is the transformed value. It is "*" therefore a local part from "{http://bar}key"; is taken, leading to "{http://bar}key"; becoming "key" and thus unqualified

HTH, Sergey

Reply via email to