私のUML図は次のようなものです:
rootNode
|
Book (attribute:name)
|
Table (attribute: Name)
|
TableEntry(attribute: Field, Value)
このコードを使用すると:
for Book in rootNode.getBooks():
print Book.getName()
for Table in Book.getTables():
print Table.getName()
for TableEntry in Table.getTableEntrys():
print TableEntry.getField(), TableEntry.getValue()
このような出力:
Document
T1
F1 V1
F2 V2
F3 V3
F4 V4
F5 V5
F6 V6
T2
F1 V1
F2 V2
F3 V3
F4 V4
F5 V5
F6 V6
Document
T2
F2 V2
F3 V3
F4 V4
F5 V5
F6 V6
Fields and Values ex- F1 and Values V1 in Document (first) と F1 V1 in Document(second) をすべてのフィールドと値について比較したいと思います。「ドキュメント」である両方のファイルに同じブック名があります。また、ここの T2 に F1 と V1 がありません。