Hi,
Re: BUG 22122 (src prefix added to search results overwrites existing src prefix)
I've reopened this bug and attached a patch. Could someone review/commit please?
The descriptive comment I made in bugzilla follows:
The fix for this bug can produce undesirable results. Sometimes the "src" prefix could be defined with the exact same namespace value. sourcePrefix should check to see if the namespace value is the same when trying to make the "src" prefix unique. Sometimes can get result like:
<bar foo="bar" bar="bar" xmlns:src1064505904532="http://xml.apache.org/xindice/Query" src1064505904532:col="/db/testing/current" src1064505904532:key="doc3" xmlns:src="http://xml.apache.org/xindice/Query"/>
When expecting:
<bar foo="bar" bar="bar" src:col="/db/testing/current" src:key="doc3" xmlns:src="http://xml.apache.org/xindice/Query"/>
Patch attached above requires that the namespace as well as the prefix be passed to ElementImpl.sourcePrefix. Before trying to make a unique name for the prefix, it checks to see if the namespace of the existing prefix matches the namespace of the proposed prefix. If it does, it returns the prefix unaltered. -Terry