简体   繁体   中英

Using regular expressions in the Search Core Results web part XSLT

The Search Core Results SharePoint web part uses XSLT 1.0 to transform search results for display. I would like to manipulate some of the result text using regular expressions. Alas, XSLT 2.0 (containing regular expression support) is not available and Microsoft don't currently plan to implement it !

One thought was to override the web part but it inherits from the DataFormWebPart and methods relating to executing the transform are marked private. So I've had to rule that out.

I hoped to use EXSLT and copy and paste the functions I needed if necessary. However this doesn't appear to be an option either as according to this post , msxsl:script blocks are not available due to the security settings used in the web part.

So everything I can think of has been blocked now. :) Has anyone else been able to enable this functionality?

if you are using asp.net you should look at this project

http://www.codeplex.com/MVPXML

It implements exslt functions into asp.net transformations.

You may be brave enough to create your own results webpart, inheriting from Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.

I have never done this, so I would not do it unless you are really keen to have regex in your results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM