Replacing the I{multiref} references with the contents of the referenced nodes and remove the I{href} attribute. Warning: since the I{ref} is not cloned, @param node: A node to update. @type node: L{Element}
(self, node)
| 70 | return node |
| 71 | |
| 72 | def replace_references(self, node): |
| 73 | """ |
| 74 | Replacing the I{multiref} references with the contents of the |
| 75 | referenced nodes and remove the I{href} attribute. Warning: since |
| 76 | the I{ref} is not cloned, |
| 77 | @param node: A node to update. |
| 78 | @type node: L{Element} |
| 79 | """ |
| 80 | href = node.getAttribute('href') |
| 81 | if href is None: |
| 82 | return |
| 83 | id = href.getValue() |
| 84 | ref = self.catalog.get(id) |
| 85 | if ref is None: |
| 86 | log.error('soap multiref: %s, not-resolved', id) |
| 87 | return |
| 88 | node.append(ref.children) |
| 89 | node.setText(ref.getText()) |
| 90 | for a in ref.attributes: |
| 91 | if a.name != 'id': |
| 92 | node.append(a) |
| 93 | node.remove(href) |
| 94 | |
| 95 | def build_catalog(self, body): |
| 96 | """ |