本文整理汇总了C++中DocumentType::getEntities方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentType::getEntities方法的具体用法?C++ DocumentType::getEntities怎么用?C++ DocumentType::getEntities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentType
的用法示例。
在下文中一共展示了DocumentType::getEntities方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
NamedNodeMap entities;
Node entityNode;
String entityName;
doc = (Document) baseT::load("staff", false);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
entities = docType.getEntities();
baseT::assertNotNull(entities, __LINE__, __FILE__);
entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1"));
baseT::assertNotNull(entityNode, __LINE__, __FILE__);
entityName = entityNode.getNodeName();
baseT::assertEquals("ent1", entityName, __LINE__, __FILE__);
}
示例2: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
NamedNodeMap entities;
Node entityNode;
String entityValue;
doc = (Document) baseT::load("staff", true);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
entities = docType.getEntities();
baseT::assertNotNull(entities, __LINE__, __FILE__);
entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1"));
baseT::assertNotNull(entityNode, __LINE__, __FILE__);
entityNode.setNodeValue(SA::construct_from_utf8("This should have no effect"));
entityValue = entityNode.getNodeValue();
baseT::assertNull(entityValue, __LINE__, __FILE__);
}
示例3: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
NamedNodeMap entityList;
Node entity;
doc = (Document) baseT::load("staff", false);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
entityList = docType.getEntities();
baseT::assertNotNull(entityList, __LINE__, __FILE__);
entity = entityList.getNamedItem(SA::construct_from_utf8("ent5"));
baseT::skipIfNull(entity);
if (("image/svg+xml" == baseT::getContentType())) {
baseT::assertSize(7, entityList, __LINE__, __FILE__);
} else {
baseT::assertSize(5, entityList, __LINE__, __FILE__);
}
}
示例4: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
NamedNodeMap entityList;
Entity entityNode;
String publicId;
String systemId;
String notation;
doc = (Document) baseT::load("staff", false);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
entityList = docType.getEntities();
baseT::assertNotNull(entityList, __LINE__, __FILE__);
entityNode = (Entity) entityList.getNamedItem(SA::construct_from_utf8("ent5"));
baseT::skipIfNull(entityNode);
publicId = entityNode.getPublicId();
baseT::assertEquals("entityURI", publicId, __LINE__, __FILE__);
systemId = entityNode.getSystemId();
baseT::assertURIEquals("systemId", "", "", "", "entityFile", "", "", "", false, systemId);
notation = entityNode.getNotationName();
baseT::assertEquals("notation1", notation, __LINE__, __FILE__);
}