Re: [xml] Re: XPath evaluation and namespace prefixes

On Thu, Mar 04, 2004 at 05:45:17PM -0500, Kei wrote:

I have a rookie question on this regard.

Let's say I have this xml document.

<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog xmlns="">
  <title>Empire Burlesque</title>
  <artist>Bob Dylan</artist>
  <title>Hide your heart</title>
  <artist>Bonnie Tyler</artist>

I'm trying to do XPath to find all the title nodes.
My XPath expression is simply "//title", and it fails to find any node.

If I remove the default xml namspace declaration in <catalog>, it works

  That's normal, that's how the XPath spec is designed.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]