GH #463: XML does not compile with XML_UNICODE_WCHAR_T

This commit is contained in:
Alex Fabijanic 2014-06-03 22:50:07 -05:00
parent 7c6e402d0e
commit ba0d9830eb
3 changed files with 9 additions and 2 deletions

View File

@ -264,7 +264,7 @@ public:
/// Creates and returns a unique namespace prefix that
/// can be used with startPrefixMapping().
bool isNamespaceMapped(const std::string& namespc) const;
bool isNamespaceMapped(const XMLString& namespc) const;
/// Returns true if the given namespace has been mapped
/// to a prefix in the current element or its ancestors.

View File

@ -22,6 +22,7 @@
#include "Poco/DOM/ElementsByTagNameList.h"
#include "Poco/DOM/AutoPtr.h"
#include "Poco/NumberParser.h"
#include "Poco/UnicodeConverter.h"
namespace Poco {
@ -417,7 +418,13 @@ const Node* AbstractContainerNode::findNode(XMLString::const_iterator& it, const
XMLString index;
while (it != end && *it != ']') index += *it++;
if (it != end) ++it;
#ifdef XML_UNICODE_WCHAR_T
std::string idx;
Poco::UnicodeConverter::convert(index, idx);
return findNode(it, end, findElement(Poco::NumberParser::parse(idx), pNode, pNSMap), pNSMap);
#else
return findNode(it, end, findElement(Poco::NumberParser::parse(index), pNode, pNSMap), pNSMap);
#endif
}
}
else

View File

@ -872,7 +872,7 @@ XMLString XMLWriter::uniquePrefix()
}
bool XMLWriter::isNamespaceMapped(const std::string& namespc) const
bool XMLWriter::isNamespaceMapped(const XMLString& namespc) const
{
return _namespaces.isMapped(namespc);
}