[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with xml-parse-string
From: |
Wojciech Meyer |
Subject: |
Re: Problems with xml-parse-string |
Date: |
Sat, 25 Sep 2010 01:25:20 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 |
Chong Yidong <address@hidden> writes:
> If what you're saying is that it might be good to push certain
> (currently unspecified) xml-handling functions into the C level,
> I agree.
Here is a draft for the API in C - some of the functions could be lifted
to Elisp (please feel free to drop comments, strip, or add what I've
missed):
access functions:
sxml-node-attributes
sxml-node-content
sxml-node-children
sxml-node-name
sxml-node-comment
sxml-node-descent
selection functions:
sxml-node-get-attribute-by-name
sxml-node-get-nodes-by-name
destructive structure updates:
sxml-node-strip-attributes
sxml-node-append
sxml-node-prepend
sxml-node-add-attribute
smxl-node-set-or-insert-attributes
smxl-node-set-or-insert-nodes
sxml-node-sort
cloning:
sxml-node-clone
mapping:
sxml-node-mapc (destructive)
sxml-node-map
collecting data:
sxml-node-flatten
sxml-node-filter-flatten
sxml-node-sparse-tree
sxml-node-leafs
visiting: (with some extra flags)
sxml-node-visit-depth
sxml-node-visit-breadth
searching:
sxml-node-find
sxml-node-search
various:
sxml-strict-sxmlp
sxml-no-attributesp
sxml-validp
sxml->xml
the rest would be done via Xpath.
Some of the XML specific things are missing (name-spaces, top-level
headers, docs, line numbers and etc.).
Open question is how to parse directly buffers (skimming through manuals
didn't give my any clue how to deal with custom buffers, AFAIU it is not
possible).
The tricky question is also how do we interface we xpath. Once we've
marshaled the tree to Lisp, we would need to either implement Xpath in
Elisp (where there is implementation already:
http://www.emacswiki.org/emacs/xpath.el
), or marshal back and again. (should be IMHO faster then Xpath in
Elisp, despite copying).
Thanks,
Wojciech
- Re: Problems with xml-parse-string, (continued)
- Re: Problems with xml-parse-string, Lars Magne Ingebrigtsen, 2010/09/25
- Re: Problems with xml-parse-string, Eli Zaretskii, 2010/09/25
- Re: Problems with xml-parse-string, David Kastrup, 2010/09/25
- Re: Problems with xml-parse-string, Wojciech Meyer, 2010/09/25
- Re: Problems with xml-parse-string, Eli Zaretskii, 2010/09/25
- Re: Problems with xml-parse-string, Wojciech Meyer, 2010/09/25
- Re: Problems with xml-parse-string, Juanma Barranquero, 2010/09/25
- Re: Problems with xml-parse-string, Chong Yidong, 2010/09/25
- Re: Problems with xml-parse-string, Stefan Monnier, 2010/09/24
- Re: Problems with xml-parse-string, Chong Yidong, 2010/09/24
- Re: Problems with xml-parse-string,
Wojciech Meyer <=
- Re: Problems with xml-parse-string, Andy Wingo, 2010/09/25
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Wojciech Meyer, 2010/09/25
- Re: Problems with xml-parse-string, Stefan Monnier, 2010/09/25
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Stefan Monnier, 2010/09/26
- Re: Problems with xml-parse-string, Leo, 2010/09/26
- pcase.el (was: Problems with xml-parse-string), Ted Zlatanov, 2010/09/25