Title: Re: [Bug] Collection.removeResource( resource ) does not work when resource is derived from XPathQueryService
As far as I understand it (which isn’t very far!) this is the expected behaviour. Why it is this way isn’t clear to me, though. If you look in the archives a few days back I posted a question about this behaviour, including a code snippet for how I got around it. It might help you if you just need to get your problem solved quickly.

Cheers,

Vanessa

Kevin Ross wrote:

Test Case:  An xpath query is issued to retrieve document resources that need to be removed.



collection.removeResource( resource ) does not work when resource is derived from the XPathQueryService.  It looks as if the reason may be because the resource.getId() is null when coming from the XPathQueryService.  



What could be the problem?



Kevin Ross



---------------------------------------------------------

Here is the ResourceSet retrieved via the XPathQueryService.  Notice the results below which have valid documentIds.



// ResourceSet retrieved via XPathQueryService

<?xml version="1.0" encoding="UTF-8"?>

<xapi:resourceSet xapi:collectionURI="xmldb:xindice:///db/profile/person" xmlns:xapi="http://www.xmldb.org/xapi/ResourceSet">

           <xapi:resource xapi:documentID="68ff584058c71fdd000000ee5607171f">

                       <person id="82808080808080808080808080808180" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./person.xsd" xmlns:src="" src:col="/db/profile/person" src:key="68ff584058c71fdd000000ee5607171f">

                                   <name xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                               <first xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                               <middle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                               <last xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                   </name>

                       </person>

           </xapi:resource>

           <xapi:resource xapi:documentID="68ff584058c71fdd000000ee560787e6">

                       <person id="82808080808080808080808080808280" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./person.xsd" xmlns:src="" src:col="/db/profile/person" src:key="68ff584058c71fdd000000ee560787e6">

                                   <name xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                               <first xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                               <middle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                               <last xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:src="">
                                   </name>

                       </person>

           </xapi:resource>

</xapi:resourceSet>


Reply via email to