Introducing xml::namespaces #13

wants to merge 12 commits into


None yet
2 participants

thriqon commented Sep 20, 2011

With this classes, a (hopefully thorough) implementation of xml-namespaces is provided

thriqon added some commits Aug 21, 2011

namespaces-support v0.1
namespace definitions can now be queried by using
xml::node::get_namespace_definitions(). currently, only
read-only-iteration is supported.
more functionality with namespaces
setting the namespace of a node is possible
namespace namespaces reorganised
new namespaces defined: xml::namespaces

it containts the class definitions and class ns.
definitions is a container containing ns's.

reason: nested classes were too problematic
for integration into nodes and attributes

additionally, namespaces.h was added as SOURCE
to be included into make dist-files.
attributes: with namespaces
attributes have now getters/setters
for namespaces. they can also be found
via namespaces + name.
major redesign of namespaces
namespaces and namespace_definitions are seperated.
iterators are now direct children of xml::namespaces.
erasing of namespace-definitions
xml::namespaces::definitions::erase() added
xml::namespaces::get_default added
this routine returns a reference to the
default namespace (without prefix)
with tests.
removing legacy node::get_namespace()
replaced with the former call to get_namespace_o
and added auto-conversion to const char* to
xml::namespaces::ns returning the href-attribute.

@ghost ghost assigned vslavik Mar 19, 2012

@vslavik vslavik referenced this pull request Jun 26, 2013


XPath support #14


vslavik commented Jul 8, 2013

Thanks a lot! I merged this onto the namespaces-rework branch for now, after fixing some issues (such as invalid memory accesses). But I think it's more complicated then necessary, so I'll want to revisit this code before merging to master. For example, it not only adds namespace object (this mirrors libxml2's object), but also two more that I think aren't necessary. The NS class even doesn't wrap libxml2 and still uses relatively expensive lookup when setting the namespace.

In short, I'm not quite sure what to do with the API yet. For now, I opted for slowing adding non-controversial bits (such as set_namespace() and the subsequent XPath additions linked above).

@vslavik vslavik closed this Jul 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment