On Thu, 25 Sep 2003 13:32:32 -0400, Terry Rosenbaum wrote: > 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
One question. As the documents the differences are in text as opposed to xml structure (they compare as the same) why is changing the prefix a problem. If the app calling the xml is sensitive to the prefix change then I think it has a problem. It also may be the case that xindice does not use the same prefixes used in the query as are present in the resulting document. -k.