aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/general/sxml.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ref/general/sxml.texi')
-rw-r--r--doc/ref/general/sxml.texi54
1 files changed, 54 insertions, 0 deletions
diff --git a/doc/ref/general/sxml.texi b/doc/ref/general/sxml.texi
index dd635b4c..0b77afc8 100644
--- a/doc/ref/general/sxml.texi
+++ b/doc/ref/general/sxml.texi
@@ -17,6 +17,9 @@ Would be represented as
"Content"))
@end example
+In this document a list with an XML tag object in its car is sometimes
+refered to as an XML node.
+
@defun namespaced-sxml->sxml tree [namespace-prefixes='()]
Takes a tree of namespaced-sxml, and optionally an assoc list from
namespace symbols, to prefered prefix.
@@ -98,3 +101,54 @@ namespace.
@defun pi-body pi
@end defun
@end defun
+
+@section Namespaced SXML utilities
+
+Provided by the module @code{(sxml namespaced util)}.
+
+@defun xml-element-hash-key xml-tag
+Given an xml tag object @ref{xml-tag}, return a suitable key for
+@code{hash-ref} and family.
+
+These key objects should preferably not be carried around for
+long. Prefer to keep the @emph{real} xml-tag object, and only call
+this while directly referencing the hash table.
+@end defun
+
+@defun find-element target list
+@var{list} should be an element of XML nodes, and @var{target} an XML
+element object.
+
+Returns the first element of @var{list} which matches the tagname and
+namespace of @var{target}.
+@end defun
+
+@defun element-matches? element node
+Checks that the bare element @var{element} has the same tagname and
+namespaces as the begining tag of @var{node}.
+@end defun
+
+@defun on-root-element proc tree
+Apply proc to the root element of the tree. The root elemnet here is
+assumed to be the topmost ``regular'' xml component.
+
+For example, the tree
+@example
+<?doctype example?>
+<a/>
+@end example
+
+Would serialize as
+@example
+'(*TOP* (*PI* doctype "example")
+ (a))
+@end example
+
+This procedure would apply @var{proc} to @code{(a)}, and return the
+form generated by replacing @code{(a)} with the return value of
+@var{proc}.
+@end defun
+
+@defun root-element
+Extract the root element of a namespaced sxml tree.
+@end defun