diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-04 09:13:51 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-04 09:13:51 +0000 |
| commit | 3feefb47de78819fdb4a27b2a36a5fd63cecc3ba (patch) | |
| tree | 592aa33372aaedca2833c376b97769c1c491d088 | |
| parent | 1deaa13210496499da8060bebb927ddb6895c81e (diff) | |
| download | lasso-3feefb47de78819fdb4a27b2a36a5fd63cecc3ba.tar.gz lasso-3feefb47de78819fdb4a27b2a36a5fd63cecc3ba.tar.xz lasso-3feefb47de78819fdb4a27b2a36a5fd63cecc3ba.zip | |
Core XML: in xml.c, parse attributes with namespace checking
* lasso/xml/xml.c:
- use snippet->ns_uri and snippet->ns_name to parse attributes
outside of the parent node namespace.
| -rw-r--r-- | lasso/xml/xml.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index bc9644a6..7d8c093c 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -1965,7 +1965,14 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, switch (type) { case SNIPPET_ATTRIBUTE: - xmlSetProp(xmlnode, (xmlChar*)snippet->name, (xmlChar*)str); + if (snippet->ns_name) { + xmlNsPtr ns; + + ns = xmlNewNs(xmlnode, (xmlChar*)snippet->ns_uri, (xmlChar*)snippet->ns_name); + xmlSetNsProp(xmlnode, ns, (xmlChar*)snippet->name, (xmlChar*)str); + } else { + xmlSetProp(xmlnode, (xmlChar*)snippet->name, (xmlChar*)str); + } break; case SNIPPET_TEXT_CHILD: xmlAddChild(xmlnode, xmlNewText((xmlChar*)str)); |
