[xml] Re: XPath evaluation and namespace prefixes


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="www.mycoolcdcollection.com">
  <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

What steps do I need to take to make this work?
Thank you in advance,


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