本文整理汇总了C++中Owned::createXslTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Owned::createXslTransform方法的具体用法?C++ Owned::createXslTransform怎么用?C++ Owned::createXslTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owned
的用法示例。
在下文中一共展示了Owned::createXslTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xsltTransform
void CFileSpraySoapBindingEx::xsltTransform(const char* xml, const char* sheet, IProperties *params, StringBuffer& ret)
{
StringBuffer xsl;
if (!checkFileExists(sheet))
throw MakeStringException(ECLWATCH_FILE_NOT_EXIST, "Cannot open stylesheet %s",sheet);
Owned<IXslProcessor> proc = getXslProcessor();
Owned<IXslTransform> trans = proc->createXslTransform();
trans->setXmlSource(xml, strlen(xml));
trans->loadXslFromFile(sheet);
if (params)
{
Owned<IPropertyIterator> it = params->getIterator();
for (it->first(); it->isValid(); it->next())
{
const char *key = it->getPropKey();
//set parameter in the XSL transform skipping over the @ prefix, if any
const char* paramName = *key == '@' ? key+1 : key;
trans->setParameter(paramName, StringBuffer().append('\'').append(params->queryProp(key)).append('\'').str());
}
}
trans->transform(ret);
}
示例2: xsltTransform
static void xsltTransform(const char* xml, const char* sheet, IProperties *params, StringBuffer& ret)
{
if(!checkFileExists(sheet))
throw MakeStringException(-1, "Could not find stylesheet %s.",sheet);
Owned<IXslProcessor> proc = getXslProcessor();
Owned<IXslTransform> trans = proc->createXslTransform();
trans->setXmlSource(xml, strlen(xml));
trans->loadXslFromFile(sheet);
trans->copyParameters(params);
trans->transform(ret);
}