本文整理汇总了C++中DocumentType类的典型用法代码示例。如果您正苦于以下问题:C++ DocumentType类的具体用法?C++ DocumentType怎么用?C++ DocumentType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DocumentType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
String docTypeName;
String nodeValue;
NamedNodeMap attributes;
doc = (Document) baseT::load("hc_staff", false);
docType = doc.getDoctype();
if (
!(("text/html" == baseT::getContentType()))
) {
baseT::assertNotNull(docType, __LINE__, __FILE__);
}
if ((baseT::notNull(docType))) {
docTypeName = docType.getName();
if (("image/svg+xml" == baseT::getContentType())) {
baseT::assertEquals("svg", docTypeName, __LINE__, __FILE__);
} else {
baseT::assertEquals("html", docTypeName, __LINE__, __FILE__);
}
nodeValue = docType.getNodeValue();
baseT::assertNull(nodeValue, __LINE__, __FILE__);
attributes = docType.getAttributes();
baseT::assertNull(attributes, __LINE__, __FILE__);
}
}
示例2: DocumentType
Node *
DocumentType::cloneNode(bool deep) const
{
DocumentType * ret = new DocumentType(*this);
ret->setOwnerDocument(0);
return ret;
}
示例3: appendDocumentType
void MarkupAccumulator::appendDocumentType(StringBuilder& result, const DocumentType& n)
{
if (n.name().isEmpty())
return;
result.appendLiteral("<!DOCTYPE ");
result.append(n.name());
if (!n.publicId().isEmpty()) {
result.appendLiteral(" PUBLIC \"");
result.append(n.publicId());
result.append('"');
if (!n.systemId().isEmpty()) {
result.appendLiteral(" \"");
result.append(n.systemId());
result.append('"');
}
} else if (!n.systemId().isEmpty()) {
result.appendLiteral(" SYSTEM \"");
result.append(n.systemId());
result.append('"');
}
if (!n.internalSubset().isEmpty()) {
result.appendLiteral(" [");
result.append(n.internalSubset());
result.append(']');
}
result.append('>');
}
示例4: jsDocumentTypeInternalSubset
JSValue jsDocumentTypeInternalSubset(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
JSDocumentType* castedThis = static_cast<JSDocumentType*>(asObject(slot.slotBase()));
UNUSED_PARAM(exec);
DocumentType* imp = static_cast<DocumentType*>(castedThis->impl());
return jsStringOrNull(exec, imp->internalSubset());
}
示例5: jsDocumentTypeInternalSubset
JSValue jsDocumentTypeInternalSubset(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDocumentType* castedThis = static_cast<JSDocumentType*>(asObject(slotBase));
UNUSED_PARAM(exec);
DocumentType* imp = static_cast<DocumentType*>(castedThis->impl());
JSValue result = jsStringOrNull(exec, imp->internalSubset());
return result;
}
示例6: jsDocumentTypeNotations
JSValue jsDocumentTypeNotations(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDocumentType* castedThis = static_cast<JSDocumentType*>(asObject(slotBase));
UNUSED_PARAM(exec);
DocumentType* imp = static_cast<DocumentType*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->notations()));
return result;
}
示例7: unparsedEntityDecl
void DOMBuilder::unparsedEntityDecl(const XMLString& name, const XMLString* publicId, const XMLString& systemId, const XMLString& notationName)
{
DocumentType* pDoctype = _pDocument->getDoctype();
if (pDoctype)
{
AutoPtr<Entity> pEntity = _pDocument->createEntity(name, publicId ? *publicId : EMPTY_STRING, systemId, notationName);
pDoctype->appendChild(pEntity);
}
}
示例8: notationDecl
void DOMBuilder::notationDecl(const XMLString& name, const XMLString* publicId, const XMLString* systemId)
{
DocumentType* pDoctype = _pDocument->getDoctype();
if (pDoctype)
{
AutoPtr<Notation> pNotation = _pDocument->createNotation(name, (publicId ? *publicId : EMPTY_STRING), (systemId ? *systemId : EMPTY_STRING));
pDoctype->appendChild(pNotation);
}
}
示例9: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
NamedNodeMap attrList;
doc = (Document) baseT::load("staff", false);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
attrList = docType.getAttributes();
baseT::assertNull(attrList, __LINE__, __FILE__);
}
示例10: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType documentTypeNode;
int nodeType;
doc = (Document) baseT::load("staff", false);
documentTypeNode = doc.getDoctype();
baseT::assertNotNull(documentTypeNode, __LINE__, __FILE__);
nodeType = (int) documentTypeNode.getNodeType();
baseT::assertEquals(10, nodeType, __LINE__, __FILE__);
}
示例11: getFileTypeAndExtensions
std::string FileTypeAssociationsPreferencesPage::getFileTypeAndExtensions(const DocumentType& type)
{
std::string result = type.name();
result.append(" (");
const std::vector<std::string>& extensions = type.extensions();
for (size_t i = 0; i < extensions.size(); ++i)
{
if (i != 0)
{
result.append(";");
}
result.append("*.");
result.append(type.extensions()[i]);
}
result.append(")");
return result;
}
示例12: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
NamedNodeMap notations;
Node notationNode;
String notationName;
doc = (Document) baseT::load("staff", false);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
notations = docType.getNotations();
baseT::assertNotNull(notations, __LINE__, __FILE__);
notationNode = notations.getNamedItem(SA::construct_from_utf8("notation1"));
baseT::skipIfNull(notationNode);
notationName = notationNode.getNodeName();
baseT::assertEquals("notation1", notationName, __LINE__, __FILE__);
}
示例13: LOG
FieldCache::FieldCache(const ResultClass &resClass,
const DocumentType &docType) :
_cache()
{
LOG(debug, "Creating field cache for summary class '%s'", resClass.GetClassName());
for (uint32_t i = 0; i < resClass.GetNumEntries(); ++i) {
const ResConfigEntry *entry = resClass.GetEntry(i);
const vespalib::string fieldName(entry->_bindname);
if (docType.hasField(fieldName)) {
const Field &field = docType.getField(fieldName);
LOG(debug, "Caching Field instance for field '%s': %s.%u",
fieldName.c_str(), field.getName().data(), field.getId());
_cache.push_back(Field::CSP(new Field(field)));
} else {
_cache.push_back(Field::CSP());
}
}
}
示例14: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
NamedNodeMap notations;
Notation notationNode;
String systemId;
doc = (Document) baseT::load("staff", false);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
notations = docType.getNotations();
baseT::assertNotNull(notations, __LINE__, __FILE__);
notationNode = (Notation) notations.getNamedItem(SA::construct_from_utf8("notation2"));
baseT::skipIfNull(notationNode);
systemId = notationNode.getSystemId();
baseT::assertURIEquals("uriEquals", "", "", "", "notation2File", "", "", "", false, systemId);
}
示例15: runTest
/*
* Runs the test case.
*/
void runTest()
{
Document doc;
DocumentType docType;
String name;
doc = (Document) baseT::load("staff", false);
docType = doc.getDoctype();
baseT::assertNotNull(docType, __LINE__, __FILE__);
name = docType.getName();
if (("image/svg+xml" == baseT::getContentType())) {
baseT::assertEquals("svg", name, __LINE__, __FILE__);
} else {
baseT::assertEquals("staff", name, __LINE__, __FILE__);
}
}