I am trying to test XPath expressions for an XML file (XML Perspective) which contains a default namespace. It is my understanding that in the XPath Expression View, I should be able to define the default namespace by selecting the "Edit Namespace Prefixes" option from the View's toolbar. However, when selecting this option, nothing happens (tried on Win and Mac with Eclipse 3.7 Indigo / XML Editors and Tools v. 3.3.0).
An example XML file would be the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore xmlns="urn:sap-com:SmartForms:2000:xsf">
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
The following XPath does not return any nodes:
If I remove the statement xmlns="urn:sap-com:SmartForms:2000:xsf"
or give the namespace a prefix like xmlns:bb="urn:sap-com:SmartForms:2000:xsf"
(and add the prefix to my node names), the XPath expression works fine.
How do I use the "Edit Namespace Prefixes" feature? Is it maybe broken?