Skip to content

Commit ba0d983

Browse files
committed
GH pocoproject#463: XML does not compile with XML_UNICODE_WCHAR_T
1 parent 7c6e402 commit ba0d983

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

XML/include/Poco/XML/XMLWriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class XML_API XMLWriter: public ContentHandler, public LexicalHandler, public DT
264264
/// Creates and returns a unique namespace prefix that
265265
/// can be used with startPrefixMapping().
266266

267-
bool isNamespaceMapped(const std::string& namespc) const;
267+
bool isNamespaceMapped(const XMLString& namespc) const;
268268
/// Returns true if the given namespace has been mapped
269269
/// to a prefix in the current element or its ancestors.
270270

XML/src/AbstractContainerNode.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "Poco/DOM/ElementsByTagNameList.h"
2323
#include "Poco/DOM/AutoPtr.h"
2424
#include "Poco/NumberParser.h"
25+
#include "Poco/UnicodeConverter.h"
2526

2627

2728
namespace Poco {
@@ -417,7 +418,13 @@ const Node* AbstractContainerNode::findNode(XMLString::const_iterator& it, const
417418
XMLString index;
418419
while (it != end && *it != ']') index += *it++;
419420
if (it != end) ++it;
421+
#ifdef XML_UNICODE_WCHAR_T
422+
std::string idx;
423+
Poco::UnicodeConverter::convert(index, idx);
424+
return findNode(it, end, findElement(Poco::NumberParser::parse(idx), pNode, pNSMap), pNSMap);
425+
#else
420426
return findNode(it, end, findElement(Poco::NumberParser::parse(index), pNode, pNSMap), pNSMap);
427+
#endif
421428
}
422429
}
423430
else

XML/src/XMLWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ XMLString XMLWriter::uniquePrefix()
872872
}
873873

874874

875-
bool XMLWriter::isNamespaceMapped(const std::string& namespc) const
875+
bool XMLWriter::isNamespaceMapped(const XMLString& namespc) const
876876
{
877877
return _namespaces.isMapped(namespc);
878878
}

0 commit comments

Comments
 (0)