Пример #1
0
def idref_timestamp_resolves(root, idref, timestamp, namespaces):
    """Determines if an `idref` and `timestamp` pair resolve to an XML
    component under `root`.

    """
    root = utils.get_etree_root(root)
    timestamp = utils.parse_timestamp(timestamp)
    xpath = "//*[@id='{0}']".format(idref)
    nodes = root.xpath(xpath, namespaces=namespaces)

    return any(utils.is_equal_timestamp(timestamp, node) for node in nodes)
Пример #2
0
def idref_timestamp_resolves(root, idref, timestamp, namespaces):
    """Determines if an `idref` and `timestamp` pair resolve to an XML
    component under `root`.

    """
    root = utils.get_etree_root(root)
    timestamp = utils.parse_timestamp(timestamp)
    xpath = "//*[@id='{0}']".format(idref)
    nodes = root.xpath(xpath, namespaces=namespaces)

    return any(utils.is_equal_timestamp(timestamp, node) for node in nodes)
 def _equal_timestamps(nodeset):
     return [x for x in nodeset if utils.is_equal_timestamp(node, x)]
Пример #4
0
 def _equal_timestamps(nodeset):
     return [x for x in nodeset if utils.is_equal_timestamp(node, x)]