Re: [xml] patch: registering namespaces to XPath context in xmllint shell



On Wed, Jun 16, 2004 at 02:06:53AM +0200, Stefano Debenedetti wrote:
Daniel Veillard wrote:
On Tue, Jun 08, 2004 at 09:25:57AM -0500, Eric Haszlakiewicz wrote:

The xmllint shell does need someway to specify prefix<->namespace 
mappings.  It not very useful without that.


 I take patches 
Based on the existing code xmlShell* in debugXML.c and the example
on how to register a namespace to a context in 
 http://xmlsoft.org/examples/index.html#xpath1.c
that should not be hard, 

Here is a try at following that hint :-)
It adds a new "setns" command that requires one parameter in the 
prefix=[nsuri] format.

  Seems to look good and work just fine:

paphio:~/XML -> cat tst.xml
<comp1 xmlns="http://example.org/a"/>
paphio:~/XML -> ./xmllint --shell tst.xml
/ > ls /comp1
/ > setns a=http://example.org/a
/ > ls /a:comp1
--n        0 comp1
/ > quit
paphio:~/XML -> cat .memdump
      04:03:51 PM
 
      MEMORY ALLOCATED : 0, MAX was 12833
BLOCK  NUMBER   SIZE  TYPE
paphio:~/XML ->

  Applied and commited, thanks a lot !

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]