Link two xml files
I have two xml files with different structures and need to link them.
XML 1:
<Departments>
<Department Id='D1' />
</Departments>`
XML 2:
<Faculty Id='F1'&g开发者_开发知识库t;
<Classrooms><Classroom Name='CR1' /><Classroom Name='CR2' /></Classrooms>
</Faculty>
<Faculty Id='F2'>
<Classrooms><Classroom Name='CR3' /><Classroom Name='CR4' /></Classrooms>
</Faculty>
Now I want to link in a way that if I provide 'CR1' and 'D1' as my inputs, it should return F1. I want to link department (XML 1) and faculty (XML 2). What could be the best way to do it?
If you have the possibility to change the XML structure I would add a link to the department through an attribute on faculty in XML2 (department="d1" for example).
精彩评论