XPath/Namespace bug...
Posted: Wed Jan 29, 2003 10:35 pm
To select elements using the XPath field from a document that has mixed namespaces you have to use an "empty" namespace to select elements from the defaul namespace.
Example
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/1.0">
<head>
<title>My Page</title>
<dc:Author>Benjamin Young</dc:Author>
</head>
....
</html>
To select the "dc:Author" element I can use //dc:Author.
To select the html "title" element I have to us //:title.
It would be best to remove the need to use a ":" when selecting from the default namespace.
Thanks,
Example
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/1.0">
<head>
<title>My Page</title>
<dc:Author>Benjamin Young</dc:Author>
</head>
....
</html>
To select the "dc:Author" element I can use //dc:Author.
To select the html "title" element I have to us //:title.
It would be best to remove the need to use a ":" when selecting from the default namespace.
Thanks,