Assert(m_reader);
Element element;
- element.name = GetNameWithoutNamespace();
element.value = GetValue();
element.lang = GetLanguageTag();
element.ns = GetNamespace();
xmlTextReaderMoveToAttributeNo(m_reader, i);
XmlAttribute attribute;
- attribute.name = GetName();
+ attribute.ns = GetAttributeNamespace();
+ attribute.prefix = GetNamePrefix();
+ attribute.name = GetNameWithoutNamespace();
attribute.value = GetValue();
attribute.lang = GetLanguageTag();
LogDebug("Attribute name: " << attribute.name <<
", value: " << attribute.value <<
+ ", prefix: " << attribute.prefix <<
+ ", namespace: " << attribute.ns <<
", lang: " << attribute.lang);
parser->Accept(attribute);
}
DPL::String ret_value;
const xmlChar* value = xmlTextReaderConstValue(m_reader);
if (value) {
- ret_value = DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
}
return ret_value;
DPL::String ret_value;
const xmlChar* value = xmlTextReaderGetAttributeNo(m_reader, pos);
if (value) {
- ret_value = DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ }
+ xmlFree(const_cast<xmlChar*>(value));
+
+ return ret_value;
+ }
+
+ DPL::String GetAttributeNamespace() const
+ {
+ DPL::String ret_value;
+ const xmlChar* value = xmlTextReaderLookupNamespace(m_reader, NULL);
+ if (value) {
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
}
xmlFree(const_cast<xmlChar*>(value));
DPL::String ret_value;
const xmlChar* value = xmlTextReaderConstName(m_reader);
if (value) {
- ret_value = DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ }
+
+ return ret_value;
+ }
+
+ DPL::String GetNamePrefix() const
+ {
+ DPL::String ret_value;
+ const xmlChar* value = xmlTextReaderPrefix(m_reader);
+ if (value) {
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
}
return ret_value;
DPL::String ret_value;
const xmlChar* value = xmlTextReaderLocalName(m_reader);
if (value) {
- ret_value = DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
}
return ret_value;
DPL::String GetNamespace() const
{
DPL::String ret_value;
+
const xmlChar* value = xmlTextReaderConstNamespaceUri(m_reader);
if (value) {
- ret_value = DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
}
return ret_value;
DPL::String ret_value;
const xmlChar* value = xmlTextReaderConstXmlLang(m_reader);
if (value) {
- ret_value = DPL::FromUTF8String(reinterpret_cast<const char*>(value));
+ ret_value =
+ DPL::FromUTF8String(reinterpret_cast<const char*>(value));
}
return ret_value;