You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having problems using OWSLib with a CSW Transactional (update) request.
The operation itself is successful [1] but the the csw.results attribute is None instead of the operation results.
I tracked this down to the _parsetransactionsummary method, which is unable to parse the transaction summary element correctly because the ElementPath query doesn't match.
I think this can be fixed by searching for the transaction summary element anywhere in the document, rather than explicitly from the root element i.e:
Given the csw:TransactionSummary element is only used in a csw:TransactionalResponse (and we check for the possible presense of that element before this code is reached, as well as checking for an exception) I felt it would be okay to use a less precise query. I used an F string because the Travis tests only specified Python 3.6 or higher.
However if that isn't acceptable, this XPath can be used instead to find the element:
Reviewing the tests, I couldn't see anything for transactional support so I'm wondering if this has been silently failing up to now, or if this just affects me.
If it's general, and one of the solutions above is acceptable, I'm happy make a pull-request for it, and possibly a test if I can.
Thanks for the all the work on this library, it's already saved me days work, this is a final snag for my use-case.
Hi,
I am having problems using OWSLib with a CSW Transactional (update) request.
The operation itself is successful [1] but the the
csw.results
attribute isNone
instead of the operation results.I tracked this down to the
_parsetransactionsummary
method, which is unable to parse the transaction summary element correctly because the ElementPath query doesn't match.I think this can be fixed by searching for the transaction summary element anywhere in the document, rather than explicitly from the root element i.e:
Replace:
With:
Given the
csw:TransactionSummary
element is only used in acsw:TransactionalResponse
(and we check for the possible presense of that element before this code is reached, as well as checking for an exception) I felt it would be okay to use a less precise query. I used an F string because the Travis tests only specified Python 3.6 or higher.However if that isn't acceptable, this XPath can be used instead to find the element:
Reviewing the tests, I couldn't see anything for transactional support so I'm wondering if this has been silently failing up to now, or if this just affects me.
If it's general, and one of the solutions above is acceptable, I'm happy make a pull-request for it, and possibly a test if I can.
Thanks for the all the work on this library, it's already saved me days work, this is a final snag for my use-case.
As a workaround for this I'm using this code:
[1] Example successful CSW response (given by
etree.tostring(self._exml)
):The text was updated successfully, but these errors were encountered: