本文整理汇总了C++中CNode::AdjustPrefix方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::AdjustPrefix方法的具体用法?C++ CNode::AdjustPrefix怎么用?C++ CNode::AdjustPrefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNode
的用法示例。
在下文中一共展示了CNode::AdjustPrefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveToString
tstring CDoc::SaveToString(CNode& rNode, bool bQualified, bool bPrettyPrint)
{
if (rNode.m_pDOMNode->getParentNode() == NULL || rNode.m_pDOMNode->getParentNode()->getNodeType() == xercesc::DOMNode::DOCUMENT_FRAGMENT_NODE)
{
FinalizeRootElement(rNode);
}
CNode::InternalAdjustPrefix(rNode.m_pDOMNode, bQualified);
rNode.AdjustPrefix();
xercesc::DOMWriter* pWriter = GetWriter();
m_bWriter = true;
if (!m_sEncoding.empty())
pWriter->setEncoding(X(m_sEncoding));
if (bPrettyPrint &&
pWriter->canSetFeature(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true))
pWriter->setFeature(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true);
XMLCh* szXml = pWriter->writeToString(*(rNode.m_pDOMNode->getOwnerDocument()));
tstring sXml = XC2TS( szXml );
xercesc::XMLString::release( &szXml );
return sXml;
}
示例2: Save
void CDoc::Save(const tstring& sURI, CNode& rNode, bool bQualified, bool bPrettyPrint)
{
if (rNode.m_pDOMNode->getParentNode() == NULL || rNode.m_pDOMNode->getParentNode()->getNodeType() == xercesc::DOMNode::DOCUMENT_FRAGMENT_NODE)
{
FinalizeRootElement(rNode);
}
CNode::InternalAdjustPrefix(rNode.m_pDOMNode, bQualified);
rNode.AdjustPrefix();
xercesc::DOMWriter* pWriter = GetWriter();
m_bWriter = true;
xercesc::LocalFileFormatTarget myFormatTarget(sURI.c_str());
if (!m_sEncoding.empty())
pWriter->setEncoding(X(m_sEncoding));
if (bPrettyPrint &&
pWriter->canSetFeature(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true))
pWriter->setFeature(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true);
pWriter->writeNode(&myFormatTarget, *(rNode.m_pDOMNode->getOwnerDocument()));
}