mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-11-05 21:18:02 +00:00
changes from main repository
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// DOMParser.cpp
|
||||
//
|
||||
// $Id: //poco/svn/XML/src/DOMParser.cpp#2 $
|
||||
// $Id: //poco/svn/XML/src/DOMParser.cpp#3 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: DOM
|
||||
@@ -135,9 +135,23 @@ Document* DOMParser::parse(InputSource* pInputSource)
|
||||
|
||||
Document* DOMParser::parseString(const std::string& xml)
|
||||
{
|
||||
std::istringstream istr(xml);
|
||||
InputSource src(istr);
|
||||
return parse(&src);
|
||||
return parseMemory(xml.data(), xml.size());
|
||||
}
|
||||
|
||||
|
||||
Document* DOMParser::parseMemory(const char* xml, std::size_t size)
|
||||
{
|
||||
if (_whitespace)
|
||||
{
|
||||
DOMBuilder builder(_saxParser, _pNamePool);
|
||||
return builder.parseMemoryNP(xml, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
WhitespaceFilter filter(&_saxParser);
|
||||
DOMBuilder builder(filter, _pNamePool);
|
||||
return builder.parseMemoryNP(xml, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user