S
Stefan Franke
Hi,
I've got a little bit of a problem when dealing with namespaces and XPath.
I'm trying very basic things, like showing all the nodes of one particular
namespace. Here is my XPath statement:
//*[local-name() = 'buch' and namespace-uri() =
'http://www.example.com/buecher']
Unfortunately this doesn't work. I have found several ways to solve this
with XSLT, but I need the pure XPath statement.
My XML file looks like this:
<?xml version="1.0"?>
<!-- Dateiname: Sammlung.xml -->
<SAMMLUNG
xmlns:buch="http://www.example.com/buecher"
xmlns:cd="http://www.example.com/cds">
<buch:ARTIKEL Status="vorhanden">
<buch:TITEL>The Adventures of Huckleberry Finn</buch:TITEL>
<buch:AUTOR>Mark Twain</buch:AUTOR>
<buch
REIS>12.75</buch
REIS>
</buch:ARTIKEL>
<cd:ARTIKEL>
<cd:TITEL>Violinkonzert D-Dur</cd:TITEL>
<cd:KOMPONIST>Beethoven</cd:KOMPONIST>
<cd
REIS>14.95</cd
REIS>
</cd:ARTIKEL>
</SAMMLUNG>
Could anyone please give me a hint how to solve this problem?
Thanks,
Stefan
I've got a little bit of a problem when dealing with namespaces and XPath.
I'm trying very basic things, like showing all the nodes of one particular
namespace. Here is my XPath statement:
//*[local-name() = 'buch' and namespace-uri() =
'http://www.example.com/buecher']
Unfortunately this doesn't work. I have found several ways to solve this
with XSLT, but I need the pure XPath statement.
My XML file looks like this:
<?xml version="1.0"?>
<!-- Dateiname: Sammlung.xml -->
<SAMMLUNG
xmlns:buch="http://www.example.com/buecher"
xmlns:cd="http://www.example.com/cds">
<buch:ARTIKEL Status="vorhanden">
<buch:TITEL>The Adventures of Huckleberry Finn</buch:TITEL>
<buch:AUTOR>Mark Twain</buch:AUTOR>
<buch
</buch:ARTIKEL>
<cd:ARTIKEL>
<cd:TITEL>Violinkonzert D-Dur</cd:TITEL>
<cd:KOMPONIST>Beethoven</cd:KOMPONIST>
<cd
</cd:ARTIKEL>
</SAMMLUNG>
Could anyone please give me a hint how to solve this problem?
Thanks,
Stefan