Title: Re: [Bug] Collection.removeResource( resource ) does not work when resource is derived from XPathQueryService

This doesn’t make any sense from an API perspective.

 

  1. To remove a resource, I need a Resource object.
  2. I can get a list of Resource objects via the XUpdateQueryService

 

If the Resource object from the query service isn’t ‘real’, then why is it a Resource object?  And if I can’t use that Resource object for removal via the Collection.removeResource( Resource),   then why on earth does it exist?

 

Thanks for your pointer Vanessa, I’ll find that message and use the workaround until this is resolved.

 

Kevin

 

-----Original Message-----
From: Vanessa Williams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 12, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: Re: [Bug] Collection.removeResource( resource ) does not workwhen 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