这篇教程C++ xsltFreeStylesheet函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xsltFreeStylesheet函数的典型用法代码示例。如果您正苦于以下问题:C++ xsltFreeStylesheet函数的具体用法?C++ xsltFreeStylesheet怎么用?C++ xsltFreeStylesheet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xsltFreeStylesheet函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: xsltTransformToFileReturnCode xsltTransformToFile(xmlDocPtr doc, const char *xslFilename, const char *outputFilename) { xmlDocPtr res; xsltStylesheetPtr style; if( (xslFilename == NULL) || (outputFilename == NULL) ) { printMsg(MESSAGETYPE_ERROR, "xsltTransformToFile: Null pointer error"); return FAILED; } style = xsltParseStylesheetFile ((const xmlChar *) xslFilename); if (style == NULL) { printMsg(MESSAGETYPE_ERROR, "xsltTransformToFile: Could not parse XSLT file: %s", xslFilename); return FAILED; } res = xsltApplyStylesheet(style, doc, NULL); if(res == NULL){ printMsg(MESSAGETYPE_ERROR, "xsltTransformToFile: Problem applying stylesheet"); return FAILED; } xsltSaveResultToFilename(outputFilename, res, style, 0); xmlFreeDoc(res); xsltFreeStylesheet(style); return SUCCESS;}
开发者ID:codingpoets,项目名称:tixi,代码行数:26,
示例2: mainint main(int argc, char **argv) { xsltStylesheetPtr stylesheet = NULL; xmlDocPtr doc, res; char* stylesheetfile; char* infile; char *outfile; if (argc!=4) { printf("XSLT Transform/n2009 by thom using libxml2/nUsage:/n/txslt-transform <stylesheet> <infile> <outfile>/n"); exit(1); } stylesheetfile = argv[1]; infile = argv[2]; outfile = argv[3]; xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; stylesheet = xsltParseStylesheetFile(BAD_CAST stylesheetfile); doc = xmlParseFile(infile); res = xsltApplyStylesheet(stylesheet, doc, 0); printf("use /"%s/" to transform /"%s/" to /"%s/" .../n", stylesheetfile, infile, outfile); xsltSaveResultToFilename(outfile, res, stylesheet, 0); xsltFreeStylesheet(stylesheet); xmlFreeDoc(res); xmlFreeDoc(doc); xsltCleanupGlobals(); xmlCleanupParser(); printf("/tDone./n"); exit(0);}
开发者ID:stzschoppe,项目名称:sw-ergonomie,代码行数:32,
示例3: mainint main( int argc, char *argv[] ){ if( argc != 3 ) { std::cerr << "usage: testlibxslt1 <XSLT file> <XML file>" << std::endl; return 1; } LIBXML_TEST_VERSION xsltStylesheetPtr script = xsltParseStylesheetFile( ( const xmlChar *)argv[1] ); xmlDocPtr doc = xmlParseFile( argv[2] ); const char *params[1] = { NULL }; xmlDocPtr res = xsltApplyStylesheet( script, doc, params ); xmlChar *resTxt; int resLen; xsltSaveResultToString( &resTxt, &resLen, res, script ); std::cout << resTxt; xmlFreeDoc( res ); xmlFreeDoc( doc ); xsltFreeStylesheet( script ); xsltCleanupGlobals( ); xmlCleanupParser( ); return 0;}
开发者ID:ProjectTegano,项目名称:Tegano,代码行数:28,
示例4: xmlDocGetRootElementstatic xmlDoc *test_xslt_transforms(xmlDoc *doc, GError **error){ struct xslt_files *info = xslt_files; xmlDoc *transformed; xsltStylesheetPtr xslt = NULL; xmlNode *root_element = xmlDocGetRootElement(doc); char *attribute; while ((info->root) && (strcasecmp(root_element->name, info->root) != 0)) { info++; } if (info->root) { attribute = xmlGetProp(xmlFirstElementChild(root_element), "name"); if (attribute) { if (strcasecmp(attribute, "subsurface") == 0) { free((void *)attribute); return doc; } free((void *)attribute); } xmlSubstituteEntitiesDefault(1); xslt = get_stylesheet(info->file); if (xslt == NULL) { parser_error(error, _("Can't open stylesheet (%s)/%s"), xslt_path, info->file); return doc; } transformed = xsltApplyStylesheet(xslt, doc, NULL); xmlFreeDoc(doc); xsltFreeStylesheet(xslt); return transformed; } return doc;}
开发者ID:syuxue,项目名称:subsurface,代码行数:35,
示例5: xsltSetLoaderFuncDocumentImpl* XSLTProcessorImpl::transformDocument(DocumentImpl* doc){ // FIXME: Right now we assume |doc| is unparsed, but if it has been parsed we will need to serialize it // and then feed that resulting source to libxslt. m_resultOutput = ""; if (!m_stylesheet || !m_stylesheet->document()) return 0; globalSheet = m_stylesheet; xsltSetLoaderFunc(stylesheetLoadFunc); xsltStylesheetPtr sheet = m_stylesheet->compileStyleSheet(); globalSheet = 0; xsltSetLoaderFunc(0); if (!sheet) return 0; m_stylesheet->clearDocuments(); // Get the parsed source document. xmlDocPtr sourceDoc = (xmlDocPtr)doc->transformSource(); xmlDocPtr resultDoc = xsltApplyStylesheet(sheet, sourceDoc, NULL); DocumentImpl* result = documentFromXMLDocPtr(resultDoc, sheet); xsltFreeStylesheet(sheet); return result;}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:26,
示例6: xsl_objects_free_storage/* {{{ xsl_objects_free_storage */void xsl_objects_free_storage(zend_object *object){ xsl_object *intern = php_xsl_fetch_object(object); zend_object_std_dtor(&intern->std); zend_hash_destroy(intern->parameter); FREE_HASHTABLE(intern->parameter); zend_hash_destroy(intern->registered_phpfunctions); FREE_HASHTABLE(intern->registered_phpfunctions); if (intern->node_list) { zend_hash_destroy(intern->node_list); FREE_HASHTABLE(intern->node_list); } if (intern->doc) { php_libxml_decrement_doc_ref(intern->doc); efree(intern->doc); } if (intern->ptr) { /* free wrapper */ if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) { ((xsltStylesheetPtr) intern->ptr)->_private = NULL; } xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr); intern->ptr = NULL; } if (intern->profiling) { efree(intern->profiling); }}
开发者ID:DragonBe,项目名称:php-src,代码行数:36,
示例7: xsltFileNamevoid Docbook2XhtmlGeneratorJob::run(){ UMLDoc* umlDoc = UMLApp::app()->document(); xsltStylesheetPtr cur = NULL; xmlDocPtr doc, res; const char *params[16 + 1]; int nbparams = 0; params[nbparams] = NULL; umlDoc->writeToStatusBar(i18n("Exporting to XHTML...")); QString xsltFileName(KGlobal::dirs()->findResource("appdata", QLatin1String("docbook2xhtml.xsl"))); uDebug() << "XSLT file is'" << xsltFileName << "'"; QFile xsltFile(xsltFileName); xsltFile.open(QIODevice::ReadOnly); QString xslt = QString::fromLatin1(xsltFile.readAll()); uDebug() << "XSLT is'" << xslt << "'"; xsltFile.close(); QString localXsl = KGlobal::dirs()->findResource("data", QLatin1String("ksgmltools2/docbook/xsl/html/docbook.xsl")); uDebug() << "Local xsl is'" << localXsl << "'"; if (!localXsl.isEmpty()) { localXsl = QLatin1String("href=/"file://") + localXsl + QLatin1String("/""); xslt.replace(QRegExp(QLatin1String("href=/"http://[^/"]*/"")), localXsl); } KTemporaryFile tmpXsl; tmpXsl.setAutoRemove(false); tmpXsl.open(); QTextStream str (&tmpXsl); str << xslt; str.flush(); xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; uDebug() << "Parsing stylesheet " << tmpXsl.fileName(); cur = xsltParseStylesheetFile((const xmlChar *)tmpXsl.fileName().toLatin1().constData()); uDebug() << "Parsing file " << m_docbookUrl.path(); doc = xmlParseFile((const char*)(m_docbookUrl.path().toUtf8())); uDebug() << "Applying stylesheet "; res = xsltApplyStylesheet(cur, doc, params); KTemporaryFile tmpXhtml; tmpXhtml.setAutoRemove(false); tmpXhtml.open(); uDebug() << "Writing HTML result to temp file: " << tmpXhtml.fileName(); xsltSaveResultToFd(tmpXhtml.handle(), res, cur); xsltFreeStylesheet(cur); xmlFreeDoc(res); xmlFreeDoc(doc); xsltCleanupGlobals(); xmlCleanupParser(); emit xhtmlGenerated(tmpXhtml.fileName());}
开发者ID:behlingc,项目名称:umbrello-behlingc,代码行数:59,
示例8: clish_xslt_releasevoid clish_xslt_release(clish_xslt_t *stylesheet){ xsltStylesheet* cur = xslt_to_xsltStylesheet(stylesheet); if (!cur) return; xsltFreeStylesheet(cur);}
开发者ID:emmanuel-deloget,项目名称:klish,代码行数:8,
示例9: xsltFreeStylesheetvoidXSLT::unload(Inkscape::Extension::Extension *module){ if (!module->loaded()) { return; } xsltFreeStylesheet(_stylesheet); // No need to use xmlfreedoc(_parsedDoc), it's handled by xsltFreeStylesheet(_stylesheet); return;}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:8,
|