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)规范化 ...
随机推荐
- KrakenD: API Gateway and Manager
KrakenD: API Gateway and Manager http://www.krakend.io/
- 向OSG视图Viewer发送消息
句柄是以下面的方式传递给osgViewer::Viewer的,osgViewer::View.getCamera().setGraphicsContext(osg::GraphicsContext); ...
- Delph 两个对立程序使用消息进行控制通信
在实际应用中,总是会遇到两个独立的程序进行通信,其实通信的方式有好几种,比如进程间通信,消息通信. 项目中用到了此功能, 此功能用于锁屏程序, 下面把实现的流程和大家分享一下. 1. 在锁屏程序中,自 ...
- [web.config]如何灵活使用配置文件
摘要 在实际项目中,经常遇到比较多的环境,比如开发环境,测试环境,生产环境.对于这些环境,可能会有不同接口调用,不同的数据库连接字符串等等.那么该如何实现不同环境的参数快速切换呢?当然,最笨的方式就是 ...
- JAVA各种系统架构图及其简介
1.spring架构图 Spring是一个开源框架,是为了解决企业应用程序开发复杂性而创建的.框架的主要优势之一就是其分层架构,分层架构允许您选择使用哪一个组件,同时为J2EE应用程序开发提供集成的框 ...
- [.NET] [.net 脱壳工具]Sixxpack 最新脱壳机 通杀Sixxpack全版本by -=Msdn5 君临=
[.net 脱壳工具]Sixxpack 最新脱壳机 通杀Sixxpack全版本by -=Msdn5 君临=- 识别方法: 如果无法调戏,请上传附件艾特我.............发帖不易啊..身处大西 ...
- java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
严重性 代码 说明 项目 文件 行 禁止显示状态错误 xamarin java.lang.UnsupportedClassVersionError: com/android/dx/command/Ma ...
- 多用StringBuilder,少用字符串拼接
在C#中,在处理字符串拼接的时候,使用StringBuilder的效率会比硬拼接字符串高很多.到底有多高,如下: static void Main(string[] args) { string st ...
- iPhone开发--正则表达式获取字符串中的内容
缘起: 想获取字符串中指定的字符,考虑用正则表达式,遂写了如下的代码: NSString *htmlStr = @"oauth_token=1a1de4ed4fca40599c5e5cfe0 ...
- 使PropertyGrid控件的属性值可以显示多行的方法
第一步:重写UITypeEditor的GetEditStyle方法: 第二部:重写UITypeEditor的EditValue方法: 具体实现如下: using System; using Syste ...