Fix for XALANJ-2230.  There were two problems that together combined to make
a third:

1) By the time the NameTests in xsl:strip-space/xsl:preserve-space get to the
WhitespaceRule constructor, any namespace prefix has been resolved, and the
test rendered in a String as uri:local-name.  The problem was that this
constructor searched for the first colon in the String in order to separate
the URI from the local-name, but the URI could itself contain a colon.  It
should have searched for the last colon in the String.

2) For a NameTest that has no prefix, the code in parseContents() was looking
up the namespace associated with the default namespace.  However, the NameTest
should behave like any other XPath NameTest - i.e., a NameTest that is not a
wild-card that has no prefix should match only names that are in no namespace.
The namespace URI should only be looked up if there is a prefix.

3) If no URI was associated with the default namespace, a NameTest with no
prefix was rewritten in the form ":local-name" or ":*" for wild cards.  The
code in the WhitespaceRule constructor handled the local name case correctly,
but treated the wild card case as if it was testing for a namespace, but that
test never found a match.  Dropping the look up of the default namespace in the
problem described above eliminates these degenerate forms, which allows the
wild card to match appropriately.

Patch was reviewed by Christine Li (jycli () ca ! ibm ! com).

1 file changed