Build the specifed pat as a/b/c where missing intermediate nodes are built automatically. @param parent: A parent element on which the path is built. @type parent: I{Element} @param path: A simple path separated by (/). @type path: basestring
(self, parent, path)
| 63 | |
| 64 | @classmethod |
| 65 | def buildPath(self, parent, path): |
| 66 | """ |
| 67 | Build the specifed pat as a/b/c where missing intermediate nodes are |
| 68 | built automatically. |
| 69 | @param parent: A parent element on which the path is built. |
| 70 | @type parent: I{Element} |
| 71 | @param path: A simple path separated by (/). |
| 72 | @type path: basestring |
| 73 | @return: The leaf node of I{path}. |
| 74 | @rtype: L{Element} |
| 75 | """ |
| 76 | for tag in path.split('/'): |
| 77 | child = parent.getChild(tag) |
| 78 | if child is None: |
| 79 | child = Element(tag, parent) |
| 80 | parent = child |
| 81 | return child |
| 82 | |
| 83 | def __init__(self, name, parent=None, ns=None): |
| 84 | """ |
no test coverage detected