本文整理汇总了C++中XMLString类的典型用法代码示例。如果您正苦于以下问题:C++ XMLString类的具体用法?C++ XMLString怎么用?C++ XMLString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XMLString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: writeMarkup
void XMLWriter::writeEndElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname)
{
if (_unclosedStartTag && !(_options & CANONICAL_XML))
{
writeMarkup(MARKUP_SLASHGT);
_unclosedStartTag = false;
}
else
{
if (_unclosedStartTag)
{
writeMarkup(MARKUP_GT);
_unclosedStartTag = false;
}
writeMarkup(MARKUP_LTSLASH);
if (!localName.empty())
{
XMLString prefix = _namespaces.getPrefix(namespaceURI);
writeName(prefix, localName);
}
else
{
writeXML(qname);
}
writeMarkup(MARKUP_GT);
}
_namespaces.popContext();
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:28,代码来源:XMLWriter.cpp
示例2: fromXMLString
std::string XMLWriter::nameToString(const XMLString& localName, const XMLString& qname)
{
if (qname.empty())
return fromXMLString(localName);
else
return fromXMLString(qname);
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:7,代码来源:XMLWriter.cpp
示例3: XMLString
XMLString Name::prefix(const XMLString& qname)
{
XMLString::size_type pos = qname.find(':');
if (pos != XMLString::npos)
return XMLString(qname, 0, pos);
else
return EMPTY_NAME;
}
开发者ID:hhawk51,项目名称:georest,代码行数:8,代码来源:Name.cpp
示例4: newPrefix
void XMLWriter::declareAttributeNamespaces(const Attributes& attributes)
{
for (int i = 0; i < attributes.getLength(); i++)
{
XMLString namespaceURI = attributes.getURI(i);
XMLString localName = attributes.getLocalName(i);
XMLString qname = attributes.getQName(i);
if (!localName.empty())
{
XMLString prefix;
XMLString splitLocalName;
Name::split(qname, prefix, splitLocalName);
if (prefix.empty()) prefix = _namespaces.getPrefix(namespaceURI);
if (prefix.empty() && !namespaceURI.empty() && !_namespaces.isMapped(namespaceURI))
{
prefix = newPrefix();
_namespaces.declarePrefix(prefix, namespaceURI);
}
const XMLString& uri = _namespaces.getURI(prefix);
if ((uri.empty() || uri != namespaceURI) && !namespaceURI.empty())
{
_namespaces.declarePrefix(prefix, namespaceURI);
}
}
}
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:27,代码来源:XMLWriter.cpp
示例5: addNamespaceAttributes
void XMLWriter::addNamespaceAttributes(AttributeMap& attributeMap)
{
NamespaceSupport::PrefixSet prefixes;
_namespaces.getDeclaredPrefixes(prefixes);
for (NamespaceSupport::PrefixSet::const_iterator it = prefixes.begin(); it != prefixes.end(); ++it)
{
XMLString prefix = *it;
XMLString uri = _namespaces.getURI(prefix);
XMLString qname = NamespaceSupport::XMLNS_NAMESPACE_PREFIX;
if (!prefix.empty())
{
qname.append(toXMLString(MARKUP_COLON));
qname.append(prefix);
}
attributeMap[qname] = uri;
}
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:18,代码来源:XMLWriter.cpp
示例6: startDTD
void XMLWriter::startDTD(const XMLString& name, const XMLString& publicId, const XMLString& systemId)
{
writeMarkup("<!DOCTYPE ");
writeXML(name);
if (!publicId.empty())
{
writeMarkup(" PUBLIC \"");
writeXML(publicId);
writeMarkup("\"");
}
if (!systemId.empty())
{
writeMarkup(" SYSTEM \"");
writeXML(systemId);
writeMarkup("\"");
}
_inDTD = true;
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:18,代码来源:XMLWriter.cpp
示例7: dataElement
void XMLWriter::dataElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname,
const XMLString& data,
const XMLString& attr1, const XMLString& value1,
const XMLString& attr2, const XMLString& value2,
const XMLString& attr3, const XMLString& value3)
{
AttributesImpl attributes;
if (!attr1.empty()) attributes.addAttribute(XMLString(), XMLString(), attr1, CDATA, value1);
if (!attr2.empty()) attributes.addAttribute(XMLString(), XMLString(), attr2, CDATA, value2);
if (!attr3.empty()) attributes.addAttribute(XMLString(), XMLString(), attr3, CDATA, value3);
if (data.empty())
{
emptyElement(namespaceURI, localName, qname, attributes);
}
else
{
startElement(namespaceURI, localName, qname, attributes);
characters(data);
endElement(namespaceURI, localName, qname);
}
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:21,代码来源:XMLWriter.cpp
示例8: writeName
void XMLWriter::writeName(const XMLString& prefix, const XMLString& localName)
{
if (prefix.empty())
{
writeXML(localName);
}
else
{
writeXML(prefix);
writeMarkup(MARKUP_COLON);
writeXML(localName);
}
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:13,代码来源:XMLWriter.cpp
示例9: startElement
void DOMBuilder::startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes)
{
AutoPtr<Element> pElem = _namespaces ? _pDocument->createElementNS(uri, qname.empty() ? localName : qname) : _pDocument->createElement(qname);
const AttributesImpl& attrs = dynamic_cast<const AttributesImpl&>(attributes);
Attr* pPrevAttr = 0;
for (AttributesImpl::iterator it = attrs.begin(); it != attrs.end(); ++it)
{
AutoPtr<Attr> pAttr = new Attr(_pDocument, 0, it->namespaceURI, it->localName, it->qname, it->value, it->specified);
pPrevAttr = pElem->addAttributeNodeNP(pPrevAttr, pAttr);
}
appendNode(pElem);
_pParent = pElem;
}
开发者ID:macchina-io,项目名称:macchina.io,代码行数:14,代码来源:DOMBuilder.cpp
示例10: processingInstruction
void XMLWriter::processingInstruction(const XMLString& target, const XMLString& data)
{
if (_unclosedStartTag) closeStartTag();
prettyPrint();
writeMarkup("<?");
writeXML(target);
if (!data.empty())
{
writeMarkup(MARKUP_SPACE);
writeXML(data);
}
writeMarkup("?>");
if (_depth == 0)
writeNewLine();
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:15,代码来源:XMLWriter.cpp
示例11: hash
unsigned long NamePool::hash(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName)
{
unsigned long h = 0;
XMLString::const_iterator it = qname.begin();
XMLString::const_iterator end = qname.end();
while (it != end) h = (h << 5) + h + (unsigned long) *it++;
it = namespaceURI.begin();
end = namespaceURI.end();
while (it != end) h = (h << 5) + h + (unsigned long) *it++;
it = localName.begin();
end = localName.end();
while (it != end) h = (h << 5) + h + (unsigned long) *it++;
return h;
}
开发者ID:ajcross,项目名称:poco,代码行数:14,代码来源:NamePool.cpp
示例12: split
void Name::split(const XMLString& qname, XMLString& prefix, XMLString& localName)
{
XMLString::size_type pos = qname.find(':');
if (pos != XMLString::npos)
{
prefix.assign(qname, 0, pos);
localName.assign(qname, pos + 1, qname.size() - pos - 1);
}
else
{
prefix.clear();
localName.assign(qname);
}
}
开发者ID:hhawk51,项目名称:georest,代码行数:14,代码来源:Name.cpp
示例13: addAttributes
void XMLWriter::addAttributes(AttributeMap& attributeMap, const Attributes& attributes, const XMLString& elementNamespaceURI)
{
for (int i = 0; i < attributes.getLength(); i++)
{
XMLString namespaceURI = attributes.getURI(i);
XMLString localName = attributes.getLocalName(i);
XMLString qname = attributes.getQName(i);
if (!localName.empty())
{
XMLString prefix;
if (namespaceURI != elementNamespaceURI)
prefix = _namespaces.getPrefix(namespaceURI);
if (!prefix.empty())
{
qname = prefix;
qname.append(toXMLString(MARKUP_COLON));
}
else qname.clear();
qname.append(localName);
}
attributeMap[qname] = attributes.getValue(i);
}
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:23,代码来源:XMLWriter.cpp
示例14: endElement
void currencyHandler::endElement(const XMLString& uri,
const XMLString& localName, const XMLString& qname) {
//where("endElement");
//std::cout<<"localName is "<<localName<<" allCurrencies size is "<<allCurrencies.size()<<std::endl;
if (localName.compare("resource") == 0) {
std::cout << " Quote ending here.." << std::endl;
inQuote = false;
currency c = *currentReadingCurrency;
allCurrencies.push_back(c);
/*****************/
//we can totally ignore comment these lines
// delete currentReadingCurrency;
// currentReadingCurrency = new currency();
/***********************/
std::cout << " currentReadingCurrency.toString() is "
<< currentReadingCurrency->toString() << std::endl;
std::cout << " c.toString() is " << c.toString() << std::endl;
}
}
开发者ID:taabodim,项目名称:QpidClient,代码行数:23,代码来源:currencyHandler.cpp
示例15: csl_assert
int CSAX2ParserBase::HandleExternalEntityRef(const XML_Char* context, const XML_Char* base,
const XML_Char* systemId, const XML_Char* publicId)
{
csl_assert (systemId != NULL);
if (context == NULL && !m_includeExtParEntities) return 0;
if (context != NULL && !m_includeExtGenEntities) return 0;
CInputSource* pInputSource = NULL;
XMLString resolvedSystemId;
if (base)
resolvedSystemId = ResolveSystemId(base, systemId);
else
resolvedSystemId = systemId;
CEntityResolver* pEntityResolver = NULL;
CEntityResolverImp defaultResolver;
XMLString pId;
if (publicId) pId = XMLString(publicId);
if (m_pEntityResolver)
{
pInputSource = m_pEntityResolver->ResolveEntity(publicId ? &pId : NULL, resolvedSystemId);
pEntityResolver = m_pEntityResolver;
}
if (!pInputSource && m_includeExtGenEntities)
{
pInputSource = defaultResolver.ResolveEntity(publicId ? &pId : NULL, resolvedSystemId);
pEntityResolver = &defaultResolver;
}
if (pInputSource)
{
XML_Parser extParser = XML_ExternalEntityParserCreate(GetExpatParser(), context, 0);
XML_SetBase(extParser, resolvedSystemId.c_str());
try
{
if (pInputSource->GetCharacterStream())
{
ParseCharExternal(extParser, pInputSource->GetCharacterStream());
}
else if (pInputSource->GetByteStream())
{
ParseExternal(extParser, pInputSource->GetByteStream());
}
else
{
throw CSAXParseException("no input stream", EMPTY_STRING, pInputSource->GetSystemId(), 0, 0, CXMLException(CXMLException::EXMLBadInputSource, string()));
}
}
catch (CXMLException& e)
{
// cleanup before we propagate the exception
pEntityResolver->DoneWithInputSource(pInputSource);
XML_ParserFree(extParser);
throw e;
}
pEntityResolver->DoneWithInputSource(pInputSource);
XML_ParserFree(extParser);
return 1;
}
else
{
return 0;
}
}
开发者ID:craigsapp,项目名称:humextra,代码行数:69,代码来源:SAX2ParserBase.cpp
示例16: doctypePI
static void doctypePI(xercesc::DocTypeHandler& self, const XMLString& target, const XMLString& data) {
self.doctypePI(target.ptr(), data.ptr());
}
开发者ID:Zekom,项目名称:pyXerces,代码行数:3,代码来源:DocTypeHandler.cpp
示例17: endElement
static void endElement(xercesc::DocumentHandler& self, const XMLString& name) {
self.endElement(name.ptr());
}
开发者ID:Zekom,项目名称:pyXerces,代码行数:3,代码来源:DocumentHandler.cpp
示例18: doctypeWhitespace
static void doctypeWhitespace(xercesc::DocTypeHandler& self, const XMLString& chars) {
self.doctypeWhitespace(chars.ptr(), chars.size());
}
开发者ID:Zekom,项目名称:pyXerces,代码行数:3,代码来源:DocTypeHandler.cpp
示例19: writeXML
void XMLWriter::writeXML(const XMLString& str) const
{
_pTextConverter->write((const char*) str.data(), (int) str.size()*sizeof(XMLChar));
}
开发者ID:BrianHoldsworth,项目名称:Poco,代码行数:4,代码来源:XMLWriter.cpp
示例20: processingInstruction
static void processingInstruction(xercesc::DocumentHandler& self, const XMLString& target, const XMLString& data) {
self.processingInstruction(target.ptr(), data.ptr());
}
开发者ID:Zekom,项目名称:pyXerces,代码行数:3,代码来源:DocumentHandler.cpp
注:本文中的XMLString类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论