Ticket #45 (closed Defect: Fixed)
node selection + namespaces
| Reported by: | raf_n | Owned by: | Mircea Amarascu |
|---|---|---|---|
| Priority: | Minor | Milestone: | |
| Component: | XCAP protocol | Version: | |
| Severity: | Non-critical | Keywords: | |
| Cc: |
Description
Given following presence document:
<?xml version="1.0" encoding="UTF-8"?>
<cr:ruleset xmlns="urn:ietf:params:xml:ns:pres-rules"
xmlns:pr="urn:ietf:params:xml:ns:pres-rules" xmlns:cr="urn:ietf:params:xml:ns:common-policy"> <cr:rule id="a">
<cr:conditions>
<cr:identity>
<cr:one id="sip:user@example.com"/>
</cr:identity>
</cr:conditions> <cr:actions>
<pr:sub-handling>allow</pr:sub-handling>
</cr:actions> <cr:transformations/>
</cr:rule>
</cr:ruleset>
Performing query http://xcap-server.com/pres-rules/users/sip:test01@domain.com/pres-rules/~~/cp:ruleset/?xmlns(cp=urn:ietf:params:xml:ns:common-policy) returns a 404. Reason seems to be in line 211 of init.py: selector = node_selector.element_selector + '/' + node_selector.terminal_selector
The node_selector.terminal_selector can have type None (set in uri.py line 92: self.terminal_selector = None).
Only adding the terminal_selector when it has been set solves the issue.
Second question: When i want to query the sub-handling element in my example xml is following url the shortest way?
I have the feeling that using urn:ietf:params:xml:ns:pres-rules as default namespace is odd (defined in class PresenceRulesApplication(ApplicationUsage)), given that pres-rules is an extension to namespace urn:ietf:params:xml:ns:common-policy.
Kind regards
Raf Nulens
