Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » XPath Namespace Prefixes Problem(How to use XPath expression in the XML Perspective to work with default namespaces)
XPath Namespace Prefixes Problem [message #718102] Tue, 23 August 2011 09:14 Go to next message
timbuktu80 is currently offline timbuktu80Friend
Messages: 1
Registered: August 2011
Junior Member
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:
//book


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?
Re: XPath Namespace Prefixes Problem [message #720912 is a reply to message #718102] Wed, 31 August 2011 13:33 Go to previous messageGo to next message
David Carver is currently offline David CarverFriend
Messages: 174
Registered: July 2009
Senior Member
This is a known bug that has recently had a patch created. See

https://bugs.eclipse.org/bugs/show_bug.cgi?id=348737

I'll see if I can make some time this weekend to address these issues and at least get them into the next milestone release.

Re: XPath Namespace Prefixes Problem [message #721447 is a reply to message #720912] Thu, 01 September 2011 19:21 Go to previous message
David Carver is currently offline David CarverFriend
Messages: 174
Registered: July 2009
Senior Member
This has been fixed, and will be in the next maintenance release.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=348737
Previous Topic:Policy problems with a WSDL file I'm trying to use...
Next Topic:Documentation for editing org.eclipse.wst.common.component?
Goto Forum:
  


Current Time: Thu Apr 25 00:14:48 GMT 2024

Powered by FUDForum. Page generated in 0.03266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top