mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-22 08:02:06 +02:00
integrated changes from main repository for upcoming 1.2.5 release
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// DOMImplementation.cpp
|
||||
//
|
||||
// $Id: //poco/1.2/XML/src/DOMImplementation.cpp#1 $
|
||||
// $Id: //poco/1.2/XML/src/DOMImplementation.cpp#2 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: DOM
|
||||
@@ -51,6 +51,8 @@ const XMLString DOMImplementation::FEATURE_CORE = toXMLString("core");
|
||||
const XMLString DOMImplementation::FEATURE_EVENTS = toXMLString("events");
|
||||
const XMLString DOMImplementation::FEATURE_MUTATIONEVENTS = toXMLString("mutationevents");
|
||||
const XMLString DOMImplementation::FEATURE_TRAVERSAL = toXMLString("traversal");
|
||||
const XMLString DOMImplementation::VERSION_1_0 = toXMLString("1.0");
|
||||
const XMLString DOMImplementation::VERSION_2_0 = toXMLString("2.0");
|
||||
|
||||
|
||||
DOMImplementation::DOMImplementation()
|
||||
@@ -66,11 +68,11 @@ DOMImplementation::~DOMImplementation()
|
||||
bool DOMImplementation::hasFeature(const XMLString& feature, const XMLString& version) const
|
||||
{
|
||||
XMLString lcFeature = Poco::toLower(feature);
|
||||
return lcFeature == FEATURE_XML && version == "1.0" ||
|
||||
lcFeature == FEATURE_CORE && version == "2.0" ||
|
||||
lcFeature == FEATURE_EVENTS && version == "2.0" ||
|
||||
lcFeature == FEATURE_MUTATIONEVENTS && version == "2.0" ||
|
||||
lcFeature == FEATURE_TRAVERSAL && version == "2.0";
|
||||
return lcFeature == FEATURE_XML && version == VERSION_1_0 ||
|
||||
lcFeature == FEATURE_CORE && version == VERSION_2_0 ||
|
||||
lcFeature == FEATURE_EVENTS && version == VERSION_2_0 ||
|
||||
lcFeature == FEATURE_MUTATIONEVENTS && version == VERSION_2_0 ||
|
||||
lcFeature == FEATURE_TRAVERSAL && version == VERSION_2_0;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// DOMWriter.cpp
|
||||
//
|
||||
// $Id: //poco/1.2/XML/src/DOMWriter.cpp#1 $
|
||||
// $Id: //poco/1.2/XML/src/DOMWriter.cpp#2 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: DOM
|
||||
@@ -63,7 +63,7 @@ DOMWriter::~DOMWriter()
|
||||
}
|
||||
|
||||
|
||||
void DOMWriter::setEncoding(const XMLString& encodingName, Poco::TextEncoding& textEncoding)
|
||||
void DOMWriter::setEncoding(const std::string& encodingName, Poco::TextEncoding& textEncoding)
|
||||
{
|
||||
_encodingName = encodingName;
|
||||
_pTextEncoding = &textEncoding;
|
||||
@@ -76,7 +76,7 @@ void DOMWriter::setOptions(int options)
|
||||
}
|
||||
|
||||
|
||||
void DOMWriter::setNewLine(const XMLString& newLine)
|
||||
void DOMWriter::setNewLine(const std::string& newLine)
|
||||
{
|
||||
_newLine = newLine;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void DOMWriter::writeNode(XMLByteOutputStream& ostr, const Node* pNode)
|
||||
}
|
||||
|
||||
|
||||
void DOMWriter::writeNode(const XMLString& systemId, const Node* pNode)
|
||||
void DOMWriter::writeNode(const std::string& systemId, const Node* pNode)
|
||||
{
|
||||
std::ofstream ostr(systemId.c_str());
|
||||
if (ostr.good())
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// NamespaceStrategy.cpp
|
||||
//
|
||||
// $Id: //poco/1.2/XML/src/NamespaceStrategy.cpp#2 $
|
||||
// $Id: //poco/1.2/XML/src/NamespaceStrategy.cpp#3 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: XML
|
||||
@@ -186,7 +186,7 @@ void NamespacePrefixesStrategy::startElement(const XMLChar* name, const XMLChar*
|
||||
XMLString attrLocal;
|
||||
XMLString attrQName;
|
||||
splitName(attrName, attrURI, attrLocal, attrQName);
|
||||
if (!attrQName.empty()) attrQName.append(":");
|
||||
if (!attrQName.empty()) attrQName += ':';
|
||||
attrQName.append(attrLocal);
|
||||
attributes.addAttribute(attrURI, attrLocal, attrQName, CDATA, attrValue, i < specifiedCount);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void NamespacePrefixesStrategy::startElement(const XMLChar* name, const XMLChar*
|
||||
XMLString local;
|
||||
XMLString qname;
|
||||
splitName(name, uri, local, qname);
|
||||
if (!qname.empty()) qname.append(":");
|
||||
if (!qname.empty()) qname += ':';
|
||||
qname.append(local);
|
||||
pContentHandler->startElement(uri, local, qname, attributes);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ void NamespacePrefixesStrategy::endElement(const XMLChar* name, ContentHandler*
|
||||
XMLString local;
|
||||
XMLString qname;
|
||||
splitName(name, uri, local, qname);
|
||||
if (!qname.empty()) qname.append(":");
|
||||
if (!qname.empty()) qname += ':';
|
||||
qname.append(local);
|
||||
pContentHandler->endElement(uri, local, qname);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// ParserEngine.cpp
|
||||
//
|
||||
// $Id: //poco/1.2/XML/src/ParserEngine.cpp#1 $
|
||||
// $Id: //poco/1.2/XML/src/ParserEngine.cpp#2 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: XML
|
||||
@@ -659,18 +659,18 @@ int ParserEngine::handleExternalEntityRef(XML_Parser parser, const XML_Char* con
|
||||
XMLString pubId;
|
||||
if (publicId) pubId.assign(publicId);
|
||||
|
||||
URI uri(pThis->_context.back()->getSystemId());
|
||||
uri.resolve(sysId);
|
||||
URI uri(fromXMLString(pThis->_context.back()->getSystemId()));
|
||||
uri.resolve(fromXMLString(sysId));
|
||||
|
||||
if (pThis->_pEntityResolver)
|
||||
{
|
||||
pEntityResolver = pThis->_pEntityResolver;
|
||||
pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, uri.toString());
|
||||
pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, toXMLString(uri.toString()));
|
||||
}
|
||||
if (!pInputSource && pThis->_externalGeneralEntities)
|
||||
{
|
||||
pEntityResolver = &defaultResolver;
|
||||
pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, uri.toString());
|
||||
pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, toXMLString(uri.toString()));
|
||||
}
|
||||
|
||||
if (pInputSource)
|
||||
@@ -719,8 +719,13 @@ void ParserEngine::handleComment(void* userData, const XML_Char* data)
|
||||
{
|
||||
ParserEngine* pThis = reinterpret_cast<ParserEngine*>(userData);
|
||||
|
||||
#if defined(XML_UNICODE_WCHAR_T)
|
||||
if (pThis->_pLexicalHandler)
|
||||
pThis->_pLexicalHandler->comment(data, 0, (int) wcslen(data));
|
||||
#else
|
||||
if (pThis->_pLexicalHandler)
|
||||
pThis->_pLexicalHandler->comment(data, 0, (int) strlen(data));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SAXParser.cpp
|
||||
//
|
||||
// $Id: //poco/1.2/XML/src/SAXParser.cpp#1 $
|
||||
// $Id: //poco/1.2/XML/src/SAXParser.cpp#2 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: SAX
|
||||
@@ -222,7 +222,7 @@ void SAXParser::parse(const XMLString& systemId)
|
||||
}
|
||||
entityResolver.releaseInputSource(pInputSource);
|
||||
}
|
||||
else throw XMLException("Cannot resolve system identifier", systemId);
|
||||
else throw XMLException("Cannot resolve system identifier", fromXMLString(systemId));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// XMLFilterImpl.cpp
|
||||
//
|
||||
// $Id: //poco/1.2/XML/src/XMLFilterImpl.cpp#1 $
|
||||
// $Id: //poco/1.2/XML/src/XMLFilterImpl.cpp#2 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: SAX
|
||||
@@ -132,7 +132,7 @@ void XMLFilterImpl::setFeature(const XMLString& featureId, bool state)
|
||||
if (_pParent)
|
||||
_pParent->setFeature(featureId, state);
|
||||
else
|
||||
throw SAXNotRecognizedException(featureId);
|
||||
throw SAXNotRecognizedException(fromXMLString(featureId));
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ bool XMLFilterImpl::getFeature(const XMLString& featureId) const
|
||||
if (_pParent)
|
||||
return _pParent->getFeature(featureId);
|
||||
else
|
||||
throw SAXNotRecognizedException(featureId);
|
||||
throw SAXNotRecognizedException(fromXMLString(featureId));
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ void XMLFilterImpl::setProperty(const XMLString& propertyId, const XMLString& va
|
||||
if (_pParent)
|
||||
_pParent->setProperty(propertyId, value);
|
||||
else
|
||||
throw SAXNotRecognizedException(propertyId);
|
||||
throw SAXNotRecognizedException(fromXMLString(propertyId));
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ void XMLFilterImpl::setProperty(const XMLString& propertyId, void* value)
|
||||
if (_pParent)
|
||||
_pParent->setProperty(propertyId, value);
|
||||
else
|
||||
throw SAXNotRecognizedException(propertyId);
|
||||
throw SAXNotRecognizedException(fromXMLString(propertyId));
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ void* XMLFilterImpl::getProperty(const XMLString& propertyId) const
|
||||
if (_pParent)
|
||||
return _pParent->getProperty(propertyId);
|
||||
else
|
||||
throw SAXNotRecognizedException(propertyId);
|
||||
throw SAXNotRecognizedException(fromXMLString(propertyId));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// XMLWriter.cpp
|
||||
//
|
||||
// $Id: //poco/1.2/XML/src/XMLWriter.cpp#1 $
|
||||
// $Id: //poco/1.2/XML/src/XMLWriter.cpp#2 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: XML
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "Poco/XML/XMLException.h"
|
||||
#include "Poco/SAX/AttributesImpl.h"
|
||||
#include "Poco/UTF8Encoding.h"
|
||||
#include "Poco/UTF16Encoding.h"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -682,7 +683,7 @@ void XMLWriter::addNamespaceAttributes(AttributeMap& attributeMap)
|
||||
|
||||
if (!prefix.empty())
|
||||
{
|
||||
qname.append(MARKUP_COLON);
|
||||
qname.append(toXMLString(MARKUP_COLON));
|
||||
qname.append(prefix);
|
||||
}
|
||||
attributeMap[qname] = uri;
|
||||
@@ -705,7 +706,7 @@ void XMLWriter::addAttributes(AttributeMap& attributeMap, const Attributes& attr
|
||||
if (!prefix.empty())
|
||||
{
|
||||
qname = prefix;
|
||||
qname.append(MARKUP_COLON);
|
||||
qname.append(toXMLString(MARKUP_COLON));
|
||||
}
|
||||
else qname.clear();
|
||||
qname.append(localName);
|
||||
@@ -746,7 +747,7 @@ void XMLWriter::writeXML(XMLChar ch) const
|
||||
}
|
||||
|
||||
|
||||
void XMLWriter::writeName(const std::string& prefix, const std::string& localName)
|
||||
void XMLWriter::writeName(const XMLString& prefix, const XMLString& localName)
|
||||
{
|
||||
if (prefix.empty())
|
||||
{
|
||||
|
Reference in New Issue
Block a user