29 #ifndef __NCML_MODULE__XML_HELPERS_H__
30 #define __NCML_MODULE__XML_HELPERS_H__
46 #include <libxml/xmlstring.h>
59 static void xmlCharToString(
string& stringToFill,
const xmlChar* pChars);
136 vector<XMLAttribute> _attributes;
179 bool isInMap(
const string& prefix)
const;
189 typedef vector<XMLNamespace>::iterator iterator;
191 XMLNamespaceMap::iterator findNonConst(
const string& prefix);
194 vector<XMLNamespace> _namespaces;
240 vector<XMLNamespaceMap> _stack;
244 #endif // __NCML_MODULE__XML_HELPERS_H__
void fromSAX2Namespace(const xmlChar **namespaces)
Assuming the pointer is an array of two strings: {prefix, uri}.
XMLNamespaceMap::const_iterator find(const string &prefix) const
Return the iterator to the element or end() if not found.
XMLNamespaceMap::const_iterator end() const
vector< XMLNamespaceMap >::const_reverse_iterator const_iterator
XMLAttributeMap::const_iterator begin() const
vector< XMLAttribute >::iterator iterator
XMLNamespace & operator=(const XMLNamespace &rhs)
bool isInMap(const string &prefix) const
XMLNamespaceStack & operator=(const XMLNamespaceStack &rhs)
An abstract superclass for NCMLArray that handles the non-parameterized functionality and allows u...
const XMLNamespaceMap & top() const
static string xmlCharToStringFromIterators(const xmlChar *startPtr, const xmlChar *endPtr)
string getAsXMLString() const
Get the standard string version as found in an element: prefix:localname="value" localname="value" if...
const string getValueForLocalNameOrDefault(const string &localname, const string &defVal="") const
If there is an attribute with localname, return its value, else return default.
const XMLAttribute * getAttributeByLocalName(const string &localname) const
These return null if the attribute was not found.
XMLNamespace(const string &prefix="", const string &uri="")
void fromSAX2Namespaces(const xmlChar **pNamespaces, int numNamespaces)
Read them all in from the xmlChar array.
XMLAttribute & operator=(const XMLAttribute &rhs)
XMLNamespaceMap::const_iterator begin() const
string getAllNamespacesAsAttributeString() const
Get a big string full of xmlns:prefix="uri" attributes, separated by spaces.
void addAttribute(const XMLAttribute &attribute)
TODO how do we tell if this exists? Does it replace? Do we care?
void getFlattenedNamespacesUsingLexicalScoping(XMLNamespaceMap &nsFlattened) const
Scanning from the stack top downwards, add the first found new XMLNamespace (in terms of its prefix) ...
string getAsAttributeString() const
Get the namespace as attribute string, ie "xmlns:prefix=\"uri"" for serializing.
XMLAttribute(const string &localName="", const string &value="", const string &prefix="", const string &nsURI="")
static string xmlCharToString(const xmlChar *pChars)
XMLAttributeMap::const_iterator end() const
XMLNamespaceStack::const_iterator begin() const
Starts from the top (most recently pushed) and iterates to the bottom (first pushed).
vector< XMLAttribute >::const_iterator const_iterator
string getAllAttributesAsString() const
The classic {prefix:}foo="value" whitespace separated.
const XMLAttribute * getAttributeByQName(const string &qname) const
void push(const XMLNamespaceMap &nsMap)
void addNamespace(const XMLNamespace &ns)
If the given prefix is already in the map, ns REPLACES it.
XMLNamespaceStack::const_iterator end() const
string getQName() const
get the name with the prefix:localname if prefix not empty else localname
XMLNamespaceMap & operator=(const XMLNamespaceMap &rhs)
vector< XMLNamespace >::const_iterator const_iterator
void fromSAX2NamespaceAttributes(const xmlChar **chunkOfFivePointers)
Fill in the fields from the SAX2 namespace attributes array.