本文整理汇总了C++中DOMDocument::createProcessingInstruction方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMDocument::createProcessingInstruction方法的具体用法?C++ DOMDocument::createProcessingInstruction怎么用?C++ DOMDocument::createProcessingInstruction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMDocument
的用法示例。
在下文中一共展示了DOMDocument::createProcessingInstruction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
XMLString::transcode("FirstSiblingChild2", tempStr, 3999);
DOMElement* E112 = doc->createElement(tempStr);
E11->appendChild(E112);
XMLString::transcode("SecondSiblingChild1", tempStr, 3999);
DOMElement* E121 = doc->createElement(tempStr);
E12->appendChild(E121);
XMLString::transcode("Attr01", tempStr, 3999);
DOMAttr* attr02 = doc->createAttribute(tempStr);
rem = E12->setAttributeNode(attr02);
if (rem)
rem->release();
XMLString::transcode("SecondSiblingChild2", tempStr, 3999);
DOMElement* E122 = doc->createElement(tempStr);
E12->appendChild(E122);
XMLString::transcode("ThirdSiblingChild1", tempStr, 3999);
DOMElement* E131 = doc->createElement(tempStr);
E13->appendChild(E131);
XMLString::transcode("DocComment", tempStr, 3999);
DOMComment* comment = doc->createComment(tempStr);
root->appendChild(comment);
XMLString::transcode("DocCDataSection", tempStr, 3999);
DOMCDATASection* cdataSec = doc->createCDATASection(tempStr);
E11->appendChild(cdataSec);
XMLString::transcode("DocPI", tempStr, 3999);
XMLCh piStr[] = {chLatin_D, chLatin_o, chLatin_c, chLatin_P, chLatin_I, chNull};
DOMProcessingInstruction* docPI = doc->createProcessingInstruction(piStr, tempStr);
E13->appendChild(docPI);
/*
following are whatToShow types:
SHOW_ALL = 0x0000FFFF,
SHOW_ELEMENT = 0x00000001,
SHOW_ATTRIBUTE = 0x00000002,
SHOW_TEXT = 0x00000004,
SHOW_CDATA_SECTION = 0x00000008,
SHOW_ENTITY_REFERENCE = 0x00000010,
SHOW_ENTITY = 0x00000020,
SHOW_PROCESSING_INSTRUCTION = 0x00000040,
SHOW_COMMENT = 0x00000080,
SHOW_DOCUMENT = 0x00000100,
SHOW_DOCUMENT_TYPE = 0x00000200,
SHOW_DOCUMENT_FRAGMENT = 0x00000400,
SHOW_NOTATION = 0x00000800
*/
////////// NodeIterator Test Cases ////////////////
{
// all node iterating test
DOMNode* node = doc->getFirstChild();
UNUSED(node); // silence warning
unsigned long whatToShow = DOMNodeFilter::SHOW_ALL;
MyFilter* filter = new MyFilter(0);
DOMNodeIterator* iter = ((DOMDocumentTraversal*)doc)->createNodeIterator(root, whatToShow, filter, true);