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

Re: [xml] Escaping '/' in xpath



On Fri, Mar 30, 2001 at 03:36:38PM +0100, Wendsomde Yameogo wrote:
> Hi,
> 
> I would like to evaluate an Xpath expression which contains the '/'
> character, which is also an operator in xpath. How to escape this
> character or replace it with an entity reference? I couldnīt find
> anything about it in the xpath spec. There is something about escaping
> characters like '<' and other xml specific characters but nothing about
> '/' which is an xpath operator.
> 
> My expression looks like:
> 
> /descendant-or-self::http://www.whatever.com:NodeName
> 
> (trying to find all NodeName Nodes with namespace
> "http//:www.whatever.com")

  Use the following:
    http://www.w3.org/TR/xpath#function-namespace-uri

 /descendant-or-self::*[function-namespace-uri() = 'http://www.whatever.com'
                        and local-name() = 'NodeName']

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




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