本文整理汇总了C++中XSLImportRule::styleSheet方法的典型用法代码示例。如果您正苦于以下问题:C++ XSLImportRule::styleSheet方法的具体用法?C++ XSLImportRule::styleSheet怎么用?C++ XSLImportRule::styleSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XSLImportRule
的用法示例。
在下文中一共展示了XSLImportRule::styleSheet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: locateStylesheetSubResource
xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri)
{
bool matchedParent = (parentDoc == document());
for (unsigned i = 0; i < m_children.size(); ++i) {
XSLImportRule* import = m_children.at(i).get();
XSLStyleSheet* child = import->styleSheet();
if (!child)
continue;
if (matchedParent) {
if (child->processed())
continue; // libxslt has been given this sheet already.
// Check the URI of the child stylesheet against the doc URI.
// In order to ensure that libxml canonicalized both URLs, we get the original href
// string from the import rule and canonicalize it using libxml before comparing it
// with the URI argument.
CString importHref = import->href().utf8();
xmlChar* base = xmlNodeGetBase(parentDoc, (xmlNodePtr)parentDoc);
xmlChar* childURI = xmlBuildURI((const xmlChar*)importHref.data(), base);
bool equalURIs = xmlStrEqual(uri, childURI);
xmlFree(base);
xmlFree(childURI);
if (equalURIs) {
child->markAsProcessed();
return child->document();
}
continue;
}
xmlDocPtr result = import->styleSheet()->locateStylesheetSubResource(parentDoc, uri);
if (result)
return result;
}
return 0;
}
示例2: clearDocuments
void XSLStyleSheet::clearDocuments()
{
m_stylesheetDoc = 0;
for (unsigned i = 0; i < m_children.size(); ++i) {
XSLImportRule* import = m_children.at(i).get();
if (import->styleSheet())
import->styleSheet()->clearDocuments();
}
}
示例3: clearDocuments
void XSLStyleSheet::clearDocuments()
{
m_stylesheetDoc = 0;
unsigned len = length();
for (unsigned i = 0; i < len; ++i) {
StyleBase* rule = item(i);
if (rule->isImportRule()) {
XSLImportRule* import = static_cast<XSLImportRule*>(rule);
if (import->styleSheet())
import->styleSheet()->clearDocuments();
}
}
}