From 159e54f5d2df4eb811be0d40c50a16bb215acd7b Mon Sep 17 00:00:00 2001
From: Michael R Sweet
Date: Mon, 8 Nov 2010 16:07:05 +0000
Subject: [PATCH] Add mxmlFindValue API (STR #110)
---
CHANGES | 4 ++-
README | 7 +++-
doc/basics.html | 13 ++++++++
doc/intro.man | 7 ++++
doc/reference.html | 23 +++++++++++++
doc/relnotes.html | 6 ++++
mxml-search.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++
mxml.h | 1 +
mxml.xml | 21 ++++++++++++
mxmldoc.c | 13 ++++++--
testmxml.c | 54 ++++++++++++++++++++++++++++--
11 files changed, 224 insertions(+), 7 deletions(-)
diff --git a/CHANGES b/CHANGES
index c962908..a7453f0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,10 +1,12 @@
-CHANGES - 2010-11-07
+CHANGES - 2010-11-08
--------------------
CHANGES IN Mini-XML 2.7
- Updated the source headers to reference the Mini-XML license and its
exceptions to the LGPL2 (STR #108)
+ - Added a new mxmlFindValue() function to find the value node of a
+ named element (STR #110)
- Building a static version of the library did not work on Windows
(STR #112)
- The shared library did not include a destructor for the thread-
diff --git a/README b/README
index ed5af99..620c5d7 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README - 2010-09-19
+README - 2010-11-08
-------------------
@@ -156,6 +156,11 @@ DOCUMENTATION
... do something ...
}
+ The "mxmlFindValue()" function finds the (first) value node under a specific
+ element using a "path":
+
+ mxml_node_t *value = mxmlFindValue(tree, "path/to/*/foo/bar");
+
Finally, once you are done with the XML data, use the "mxmlDelete()"
function to recursively free the memory that is used for a particular node
or the entire tree:
diff --git a/doc/basics.html b/doc/basics.html
index 6804a3a..9ca0838 100644
--- a/doc/basics.html
+++ b/doc/basics.html
@@ -522,5 +522,18 @@ three constants:
+Finding Value Nodes
+
+You can find the value of a specific node in the tree using the mxmlFindValue, for example:
+
+
+ mxml_node_t *value = mxmlFindValue(tree, "path/to/*/foo/bar");
+
+
+The second argument is a "path" to the parent node. Each component of the
+path is separated by a slash (/) and represents a named element in the document
+tree or a wildcard (*) path representing 0 or more intervening nodes.
+