This patch implements basic support for xml namespaces
in TinyXml.
It does this in a completely optional way. By default,
namespace support is not included. To include it, #define
TIXML_USE_XMLNAMESPACES
Namespace support is tricky only in terms of the
stack-based nature of namespaces. Consider the
following xml:
<html xmlns="htmlNS">
<body>
<svg xmlns="svgNS">
<path>
</svg>
<p>Hello</p>
</body>
</html>
For elements html, html>body, html>p, the namespace
URI that is associated with the element will be "htmlNS",
but for element html>svg and, importantly,
html>svg>path the namespace URI will be "svgNS".
Parsing the names/namespace keys (not URIs) was easy,
but to achieve the stack-based namespace scoping I
modified how TiXmlParsingData works.
Without namespace support everything works as it did
before.
General Notes:
- I added a convenience macro
'XMLNAMESPACE_SUPPORT' with the objective of not
having to put #ifdef..endif everywhere. I am not sure if it
is worth it. See what you think.
- (msvc) I changed the CodeGen to be Multithreaded DLL
but this was more for my stuff and not really meant to
get into the patch. Nothing too serious though.
Testing Notes:
- I did not modify the existing tests but instead built a
suite of cppunit tests for consideration. I will attach this
separately.
Output of cvs diff -bu2