Issue Details (XML | Word | Printable)

Key: XALANJ-2230
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Henry Zongaro
Reporter: Henry Zongaro
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XalanJ2

Wildcards in xsl:strip-space and xsl:preserve-space do not match elements in a namespace with XSLTC

Created: 11/Nov/05 12:18 AM   Updated: 15/Dec/07 04:22 AM
Return to search
Component/s: XSLTC
Affects Version/s: 2.7
Fix Version/s: 2.7.1

Time Tracking:
Not Specified

File Attachments:
  Size
XML File Licensed for inclusion in ASF works j2230.xml 2005-11-11 12:27 AM Henry Zongaro 0.6 kB
XML File Licensed for inclusion in ASF works j2230a.out 2005-11-11 12:30 AM Henry Zongaro 0.1 kB
XML File Licensed for inclusion in ASF works j2230a.xsl 2005-11-11 12:27 AM Henry Zongaro 0.2 kB
XML File Licensed for inclusion in ASF works j2230b.out 2005-11-11 12:30 AM Henry Zongaro 0.1 kB
XML File Licensed for inclusion in ASF works j2230b.xsl 2005-11-11 12:27 AM Henry Zongaro 0.3 kB
XML File Licensed for inclusion in ASF works j2230c.out 2005-11-11 12:30 AM Henry Zongaro 0.1 kB
XML File Licensed for inclusion in ASF works j2230c.xsl 2005-11-11 12:27 AM Henry Zongaro 0.3 kB
XML File Licensed for inclusion in ASF works j2230d.out 2005-11-11 01:12 AM Henry Zongaro 0.1 kB
XML File Licensed for inclusion in ASF works j2230d.xml 2005-11-11 01:12 AM Henry Zongaro 0.1 kB
XML File Licensed for inclusion in ASF works j2230d.xsl 2005-11-11 01:12 AM Henry Zongaro 0.3 kB
Text File Licensed for inclusion in ASF works patch.j2230.txt 2005-11-11 03:47 AM Henry Zongaro 4 kB

Xalan info: PatchAvailable
Reviewer: Christine Li
Resolution Date: 02/Dec/05 07:04 AM


 Description  « Hide
A NameTest of * in xsl:strip-space or xsl:preserve-space only matches elements that are in no namespace with XSLTC. Worse still, a NameTest of NCName:* fails to match any elements.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #351494 Thu Dec 01 22:00:53 UTC 2005 zongaro 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).
Files Changed
MODIFY /xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/Whitespace.java