Re: [xml] xmllint -shell and namespaces?



On Tue, May 07, 2002 at 05:15:58PM -0400, Artur Klauser wrote:
So, if "cd foo" does not work, what does? - other than anonymous 
references like the above "cd node()".

  the command uses an XPath argument. in XPath "foo" selects 
children element of name foo but without namespace. So that's normal.

BTW, I have similar problems if the namespace is explicit, ie. if all tags 
are prefixed with say f: and I declare xmlns:f="http://a.com/foo"; in the 
document root element. Here, neither "cd foo" nor "cd f:foo" do the trick.

  yes because at the shell level there is no way to bind namespaces to 
prefixes for XPath expressions (patch welcome could be simple).
  You can use  local-name() and namespace-uri() XPath functions in the mean
time
    cd *[local-name() = 'foo']

  See: http://www.w3.org/TR/xpath#function-local-name

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
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]