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

Re: [xml] Ask an XPath problem



On Fri, Jun 13, 2003 at 10:49:27AM +0800, ½²µO¨Ó(²§±d) wrote:
> Hi all:
> 	
> 	I want to get the attributes from the following Xml:
> 		<?xml version="1.0"?><Object Id="a123">test123<Word>Wahaha</Word></Object>
> 	So, I use the following Location Path trying to select the attributes. I expect to get Id, a123, but I
> 	get "<Object></Object>" instead. 
> 		(//. | //@* | //namespace::*)[attribute::*]

  The XPath spec is short, read it ! This is not specific to libxml.
     http://www.w3.org/TR/xpath

//@* is what you ask.

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]