Boris Goldowsky wrote:
> My XML uses namespaces everywhere. I am not sure if there is any
> convenient way to use the Find Element - Advanced tab to do an XPath
> search in these documents? If I search for, eg
> //p
> this fails, but so does attempting to use a namespace prefix
> //d:p
> or an expanded namespace:
> //{http://www.daisy.org/z3986/2005/dtbook/}p
The Clark's notation is only supported in the parameter string of a command.
> What does work is:
> //*[local-name()='p']
>
> but this is rather inconvenient, and less precise.
>
> I know the feature may be used by relatively few people, but
> occasionally one really wants to be able to certain types of question --
> say, whether a document ever uses an image inside a sidebar -- and a
> quick XPath search comes in extremely handy.
>
I cannot reproduce this problem.
[1] I opened a DocBook 5 document.
In DocBook 5 documents, the default namespace is
"http://docbook.org/ns/docbook".
In addition, the "db" prefix is declared for the
"http://docbook.org/ns/docbook" namespace.
[2] Using "Search|Find Element", "Simple" tab:
[a] Select "First in document" using the "Find "combobox.
[b] Typed "para" in the "Element" field. It worked fine.
(The "Element" field contains a qualified XML name and not an XPath
expression).
[c] Typed "db:para" in the "Element" field. It worked fine.
[3] Now using the "Advanced" tab.
Typed "//db:para" in the "XPath expression" field. It worked fine.
Note that XPath 1.0 does not support the concept of default namespace. A
namespace must always be specified using its prefix. Hence, even if
your document has a default namespace, also declare a prefix for this
namespace and use it in the "Find Element" dialog box.
Please use "Tools|Declare Namespace" to check which exact prefixes are
available for your document. See
http://www.xmlmind.com/xmleditor/_distrib/doc/help/com.xmlmind.xmledit.cmd.namespace.PrefixPreferencesDialog.html