I have the following code:
Code: Select all
Meta::Contact::Contact(const XERCES_CPP_NAMESPACE::DOMElement* e)
{
auto emailXmlCh = XUTF8Str("email").unicodeForm();
auto emailAttribute = e->getAttribute(emailXmlCh);
name = StrXUTF8(e->getTextContent()).str;
email = StrXUTF8(emailAttribute).str;
}
It's trying to extract the "email" attribute from an XML node that looks like this:
Code: Select all
<author email="jsmith@email.com">Author Name</author>
It doesn't work... the first line gives an empty (null-char-only) string in emailXmlCh. If I step through the XUTF8Str creation everything looks OK to me, and unicodeForm() appears to be populating the internal string object without any issue. So I am clearly misunderstanding something key here. I can get the attribute just fine if I iterate through the list, but that seems stupid for a such a simple use-case. Does anyone see what I'm screwing up?