我是XSL编程的新手,我想这是一个简单的问题:如何在没有路径的情况下获取文件名?目前我的代码看起来像这样,我得到了整个路径: Result.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<All_Results>
<Result>
<id>1</id>
<workid>144</workid>
<rank>100000000</rank>
<title>Test Dokument</title>
<author_multival>Test</author_multival>
<author>Test</author>
<size>34185</size>
<url>https://test.test.com/docs/globalit/Lists/Documents/Datumtest/Test.docx</url>
<urlEncoded>https%3A%2F%2Ftest%2Etest%2Ecom%2Fdocs%2Fglobalit%2FLists%2FDocuments%2FDatumtest%2FTest%2Edocx</urlEncoded>
<description></description>
<write>5/3/2013</write>
<sitename>https://test.test.com/docs/globalit/Lists/Documents/Datumtest</sitename>
<collapsingstatus>0</collapsingstatus>
<hithighlightedsummary>Noch mehr text Noch mehr text <ddd /> </hithighlightedsummary>
<hithighlightedproperties>
<HHTitle>Test Dokument</HHTitle>
<HHUrl>https://test.test.com/docs/globalit/Lists/Documents/Datumtest/Test.docx</HHUrl>
</hithighlightedproperties>
<contentclass>STS_ListItem_DocumentLibrary</contentclass>
<isdocument>True</isdocument>
<picturethumbnailurl></picturethumbnailurl>
<serverredirectedurl>https://test.test.com/docs/globalit/_layouts/WordViewer.aspx?id=/docs/globalit/Lists/Documents/Datumtest/Test.docx&DefaultItemOpen=1</serveedirectedurl>
<doclanguage>German</doclanguage>
<doctitle>Test</doctitle>
<docauthor>Team</docauthor>
<revisiondate>5/3/2013</revisiondate>
<filename>Test.docx</filename>
<fileextension>DOCX</fileextension>
<imageurl imageurldescription="Microsoft Word">/_layouts/images/icdocx.png</imageurl>
</Result>
</All_Results>
Run Code Online (Sandbox Code Playgroud)
result.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="TotalResults" />
<xsl:template match="NumberOfResults" />
<xsl:template name="DisplayString">
<xsl:param name="str" />
<xsl:if test='string-length($str) > 0'>
<xsl:value-of …Run Code Online (Sandbox Code Playgroud)