如何从URL获取文档库名称 [英] How to obtain document library name from the URL

查看:95
本文介绍了如何从URL获取文档库名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从URL cqwp获取文档库名称.例如,

How to obtain document library name from the URL cqwp. For example,

http:///sites/site1/DocLib/Forms/AllItems.aspx

我知道xsl有子字符串功能

I know there is substring function with xsl

<xsl:param name="DocLibName"> 
  select=substring(url) or whatever the code should be
</xsl:param>

推荐答案

  1. 一些很好的链接.

http://msdn.microsoft.com/zh-cn/library/dd583143(office.11​​).aspx

  1. 添加这两行

<xsl:variable name="DocLibName" select="substring-before(substring-after($PageUrl, '/Forms/'), '/')" />

<xsl:param name="PageUrl"/>

  1. 设置VIEWFLAG = 1(应该在属性窗口中)

  1. set VIEWFLAG=1 (it should be in the properties windows)

查找此行并修改是否要过滤Webpart列表

Find this line and modify if you want Filter the webpart list

<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />

将其更改为以下内容

<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[(@CustomerNo=$DocLibName)]"/>

您可以使用它来显示

<xsl:value-of select="$DocLibName"> <br/>

<xsl:value-of select="$PageUrl"/><br/>

这篇关于如何从URL获取文档库名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆