Get file extention in XSLT
When working with data view web parts or data form web parts in SharePoint, you might want to use some conditional formatting or branching logic, based on the file extention of your SharePoint item.
This xsl template returns the file extention from an URL:
|
<!-- Determine File Extention template --> <xsl:template <xsl:param <xsl:choose> <xsl:when <xsl:call-template <xsl:with-param </xsl:call-template> </xsl:when> <xsl:when <xsl:call-template <xsl:with-param </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of </xsl:otherwise> </xsl:choose> </xsl:template> |
It runs recursively through the parameter "path" and returns the extention.
You can call and use it like this:
|
<xsl:variable <xsl:call-template <xsl:with-param </xsl:call-template> </xsl:variable> <!-- example use in branching logic --> <xsl:choose> <xsl:when <!-- add your logic --> </xsl:when> </xsl:choose> |
From: http://morg.nl/2012/02/get-file-extention-in-xslt/
Get file extention in XSLT的更多相关文章
- 十三、File Translator怎么写
---恢复内容开始--- 1. File Translator可以将信息从maya中导入和导出. 2. 创建一个file translator需要从MPxFileTranslator继承. 3. 函数 ...
- xslt 和一个demo
https://www.w3.org/1999/XSL/Transform Specifications The XSLT language has three versions which are ...
- xslt转换xml
实现json--> xml --(xlst)--> xml pom依赖 <dependency> <groupId>net.sf.json-lib</grou ...
- Using XSLT and Open XML to Create a Word 2007 Document
Summary: Learn how to transform XML data into a Word 2007 document by starting with an existing docu ...
- 类handler
/** The handler class is the interface for dynamically loadable storage engines. Do not add ifdefs a ...
- 最佳vim技巧
最佳vim技巧----------------------------------------# 信息来源----------------------------------------www.vim ...
- IOS UTI统一类型标识符:判断文件类型通过后缀
今天在学习文档和数据共享中,首先讲的处理统一类型标识符UTI.第一次见,所以记下来以备之用,首先了解UTI和MIME的概念 1.同一类型标识符(Uniform Type Identifier,UTI) ...
- 经典弹出层Colorbox - a jQuery lightbox
Colorbox - a jQuery lightbox A lightweight customizable lightbox plugin for jQuery Fork me on GitHub ...
- [Node.js]Path模块
摘要 path模块提供了一些处理文件路径问题的工具. path模块 引入模块 var path=require("path"); 方法 1 path.normalize(p)规范化 ...
随机推荐
- github入门教程:第一步
[git教程] 以前在网上找过一些,见 http://www.wojilu.com/Forum1/Topic/702 我自己会一边学,一边写教程,过程中有不明白的,会跟大家请教交流. ----- ...
- HDU 4786 Fibonacci Tree (2013成都1006题)
Fibonacci Tree Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- 《Go语言实战》摘录:7.1 并发模式 - runner
7.1 并发模式 - runner
- SQLPrompt_7.2.2.273〖含注册机〗(支持低版本和最高版本SQL2016+VS2015)
SQLPrompt_7.4.1.564[含注册机](支持低版本和最高版本SQL2016+VS2015) http://download.csdn.net/detail/wozengcong/97601 ...
- asp.net core读取appsettings.json,如何读取多环境开发配置
摘要 在读取appsettings.json文件中配置的时候,觉得最简单的方式就是使用asp.net core注入的方式进行读取了. 步骤 首先根据配置项的结构定义一个配置类,比如叫AppSettin ...
- vs2012\vs2013\vs2015碰到生成时报该错误:项目中不存在目标“GatherAllFilesToPublish”
手头一个vs2010升级到vs2012后,web项目发布到本地目录时项目报错:“该项目中不存在目标“GatherAllFilesToPublish”” 通过谷歌大神的帮助,找到了解决方法.共享之. 原 ...
- AngularJS中module的导入导出
关于AngularJS中module的导入导出,在Bob告诉我之前还没写过,谢谢Bob在这方面的指导,给到我案例代码. 在AngularJS实际项目中,我们可能需要把针对某个领域的各个方面放在不同的m ...
- Javascript中的依赖注入
首先通过带参函数来定义一个Javascript函数,相当于C#中的一个类. var Person = function(firstname, lastname){ this.firstname = f ...
- iPhone开发过程中调试多次Release问题 message sent to deallocated
初级:第一步 为程序添加符号断点 malloc_error_break 方法如下. 目标效果:让程序崩溃时跳转到出错到那一行.但是往往达不到这个效果.不行就继续往下看. At times, wh ...
- cocos2d-x 真正的定时器之schedule
转载请注明,原文地址:http://blog.csdn.net/musicvs/article/details/8551066 正文: 1. 不调用update函数,调用自己的函数 其实原理是一样的, ...