With this little python script (listlinkodf.py) you can dump all (hyper)links, that are stored in the content.xml of ODF files, so you can easily see what dependencies exist, if they are valid etc.
Copy the file into a directory and start the program. The utility examines all ODF files within this directory and all its subdirectories und writes the result into a textfile (linklist.txt).
Links that reference other files within the local filesystem are checked and marked either ‘ok’ or ‘not found’.
Relative and absolute paths
We did some tests with ODF-files created with OpenOffice.org 3.1.1, KOffice and MS-Office 2007 SP2.
OpenOffice.org stores a relative path. You can change this to absolute by deselecting the corresponding checkbox under Tools->Options->Load/Save->General.
If you reference an object (e.g. test.ods) that resides in the same directory, the path that is stored in the context.xml looks like “../test.ods”. The reason for the extra “../” is, that the context.xml is part of a zip structure. To reference a file outside this zip structure you have to add this “../”. See http://www.oasis-open.org/committees/download.php/35090/OpenDocument-v1.2-part3-cd1.odt for details (2.7).
Interoperability issues
In our example, we have a directory structure like this
Level0<dir>
—– Level0.ods
—–+Level1<dir>
—–+—–Level1.ods
———–+Level2<dir>
———–+—–Level2.odt
Level2.odt has two embedded objects, i.e. Level0.ods and Level1.ods. Level2.odt was created with OpenOffice.org and the links are relative.
This is what the tool linklistodf.py shows us (the current working directory is Level0):
########## .\Level1\Level2\Level2.odt ##########
-> ../../../Level0.ods - ok
-> ../../Level1.ods - ok
If you open the file Level2.odt with MS office 2007 SP2 the result is not ok:

Interoperability issues
If you create an ODT file that has the same structure with MSO 2007SP2 and open it with OpenOffice.org, the result is much better:

Interoperability issues
But looking inside the odf structure, you can see an absolute path, a big problem when exchanging documents or using the same documents on another operating system.
########## .\Level1\Level2\Level2MSorg.odt ##########
-> file:///I:/Level0/Level0.ods - ok
-> file:///I:/Level0/Level1/Level1.ods - ok