1

How can I render a custom field type with XSLT. I want to render in the same manner like I do with this CAML

<RenderPattern Name="DisplayPattern">
    <Switch>
    <Expr>
        <Column/>
    </Expr>
    <Case Value="" />
    <Default>
        <Column SubColumnNumber="0" HTMLEncode="TRUE"/>
        <HTML><![CDATA[, nr.&nbsp;]]></HTML>
        <Column SubColumnNumber="1" HTMLEncode="TRUE"/>
        <HTML><![CDATA[<br/>Bloc&nbsp;]]></HTML>
        <Column SubColumnNumber="2" HTMLEncode="TRUE"/>
        <HTML><![CDATA[,&nbsp;Etaj&nbsp;]]></HTML>
        <Column SubColumnNumber="3" HTMLEncode="TRUE"/>
        <HTML><![CDATA[,&nbsp;Sc.&nbsp;]]></HTML>
        <Column SubColumnNumber="4" HTMLEncode="TRUE"/>
        <HTML><![CDATA[,&nbsp;Ap.&nbsp;]]></HTML>
        <Column SubColumnNumber="5" HTMLEncode="TRUE"/>
        <HTML><![CDATA[<br/>]]></HTML>
        <Column SubColumnNumber="6" HTMLEncode="TRUE"/>
        <HTML><![CDATA[,&nbsp;Jud/Sec&nbsp;]]></HTML>
        <Column SubColumnNumber="7" HTMLEncode="TRUE"/>
        <HTML><![CDATA[&nbsp;]]></HTML>
        <Column SubColumnNumber="8" HTMLEncode="TRUE"/>
    </Default>
  </Switch>
</RenderPattern>

I've tried with an XSL file like this

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" 
            xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 
            version="1.0"
            exclude-result-prefixes="xsl msxsl ddwrt" 
            xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
            xmlns:asp="http://schemas.microsoft.com/ASPNET/20" 
            xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
            xmlns:msxsl="urn:schemas-microsoft-com:xslt"
            xmlns:SharePoint="Microsoft.SharePoint.WebControls" 
            xmlns:ddwrt2="urn:frontpage:internal" ddwrt:oob="true">
<xsl:output method="html" indent="no"/>
<xsl:template match="FieldRef[@FieldType='AdresaField']" mode="Note_body">
<xsl:param name="thisNode" select="." />
<xsl:variable name="curElement" select="current()" />
<xsl:variable name="fldVal">
  <xsl:value-of select="$thisNode/@*[name()=$curElement/@Name]"/>
</xsl:variable>
<xsl:value-of select="substring($fldVal, 1, 3)"/> - Just to show it's working. Here I don't know how to do
</xsl:template>
</xsl:stylesheet>

Thank's

1 Answer 1

0

is the following link useful for you? http://www.intheknow.it/customxsltfieldrendering.ashx

3
  • 1
    Whilst this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference.
    – Alex Angas
    Commented Jul 10, 2011 at 0:08
  • This is the link which I read before posting here.
    – user3145
    Commented Jul 11, 2011 at 11:41
  • The main reason for this is because pages will disappear, as this one has. SO the answer is now gone. Commented May 28, 2019 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.