difficulties working with xml-data
advantages of xml
Xml has become the leading technology for data-exchange because of it's advantages:
- Xml is well readable for humans and computers. It is an open standard. It can be read and written by any simple text-editor.
- Xml-files can contain complex data-structures.
- Xml-interfaces can easily be changed.
- New elements can be added.
- Programs reading this modified interface simply overread the new elements.
- The programms do not crash!
- Xml-elements have not to be positioned on a special line or column.
- The order of xml-elements is normally not relevant.
But: Standard unix-tools do not work with xml-data!
The advantages of xml turn into disadvantages, because standard unix-tools like "diff", "cmp", "sort", "join" and "comm" do not work correct with xml-files. Look at the following examples:
The following two files are contentwise equal. only the order of the elements is completely different. A standard compare-tool will be not aware of this. It will always will find differences, although the files are cotentwise equal.
The " and "" of the person are in both files equal.
But in file "test2b.xml" there is no element "".
If you compare these two files for example with "diff"-utility, you cannot exclude element "" from comparison.