Im currently working with an Mpeg7 xml file and want to preform some 'selections' via. xpath.
However im a bit confused about the namespace applied to the elements in the xml file.
Here is the beginning of the xml file:
<?xml-stylesheet type="text/xsl" href="18.xsl"?>
<Mpeg7 xmlns="urn:mpeg:mpeg7:schema:2001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" xsi:schemaLocation="urn:mpeg:mpeg7:schema:2001 Mpeg7-2001.xsd">
<!-- ================================= CONTENT DESCRIPTION ================================================= -->
<!-- ************** MOVIE NUMBER 1 ************************ -->
Im not an expert at all but if i remember correct and xmlns without any prefix sets the default namespace which scope applies to all sub / descendent elements. So if elements are declared without any prefix they should belong to the default namespace which of couse dont have any prefix.
However in the mpeg7 xml file example it seem to be a little different. The Mpeg7 element declares a default namespace plus some others.
All the elements (such as Mpeg, Description, CreationInformation, Creation ...) within the Mpeg7 element (which sets all the namespaces) are not declared with any prefix and should belong to the default prefix.
So first when I wanted to make an xpath i did /Mpeg7/Description/CreationInformation but what happend ?? nothing. By trial and error I discovered that for some reason all these elements belong to the mpeg7 namespace. So for the Xpath to work i must do /mpeg7:Mpeg7/mpeg7escription/mpeg7:CreationInformation
Can anyone tell me how the mpeg7 namespace is connected to the elements that have not been declared with an mpeg7:Element prefix ??
Edit: if u want to see the full xml file u can se it here www.onk.dk/temp/source1.xml