Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

        def xml_diff(expected, compared, whitespace=True):
    # External Parsed Entities cannot have a standalone declaration or
    # DOCTYPE declaration.
    # See XML 1.0 2nd, 4.3.2, Well-Formed Parsed Entities
    sequencer = _xml_sequence
    if _textdecl_match(expected):
        # Limit the search for DOCTYPE to the content before the first element.
        # If no elements exist, it *MUST* be a parsed entity.
        match = _starttag_find(expected)
        if not match or not _doctype_find(expected, 0, match.start()):
            sequencer = _entity_sequence
    expected = sequencer(expected, whitespace)
    compared = sequencer(compared, whitespace)
    return difflib.unified_diff(expected, compared, 'expected', 'compared',
                                n=2, lineterm='')
        


src/a/m/Amara-2.0.0/test/writers/test_node_print.py   Amara(Download)
    out = s.getvalue()
    #self.assertEqual(out, ATOMENTRY1)
    diff = treecompare.xml_diff(out, ATOMENTRY1)
    diff = '\n'.join(diff)
    assert not diff, "Expected=%r, returned=%r diff=%r" % (ATOMENTRY1, out, diff)
        out = s.getvalue()
        #self.assertEqual(out, ATOMENTRY1)
        diff = treecompare.xml_diff(out, DOCTYPE_EXPECTED_1)
        diff = '\n'.join(diff)
        self.assertFalse(diff, msg=(None, diff))
        out = s.getvalue()
        #self.assertEqual(out, ATOMENTRY1)
        diff = treecompare.xml_diff(out, XHTML_EXPECTED_1)
        diff = '\n'.join(diff)
        self.assertFalse(diff, msg=(None, diff))
        out = s.getvalue()
        #self.assertEqual(out, ATOMENTRY1)
        diff = treecompare.xml_diff(out, XHTML_EXPECTED_3, whitespace=False)
        diff = '\n'.join(diff)
        self.assertFalse(diff, msg=(None, diff))

src/a/m/Amara-2.0.0/test/xslt/__init__.py   Amara(Download)
        #print expected, compared
        if method == (None, 'xml') and not omit_decl:
            diff = treecompare.xml_diff(expected, compared)
        elif method == (None, 'html'):
            diff = treecompare.html_diff(expected, compared)