Skip to content

Commit

Permalink
GH #463: XML does not compile with XML_UNICODE_WCHAR_T
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-f committed Jun 4, 2014
1 parent 7c6e402 commit ba0d983
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion XML/include/Poco/XML/XMLWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class XML_API XMLWriter: public ContentHandler, public LexicalHandler, public DT
/// 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.

Expand Down
7 changes: 7 additions & 0 deletions XML/src/AbstractContainerNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "Poco/DOM/ElementsByTagNameList.h"
#include "Poco/DOM/AutoPtr.h"
#include "Poco/NumberParser.h"
#include "Poco/UnicodeConverter.h"


namespace Poco {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion XML/src/XMLWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ba0d983

Please sign in to comment.