I am editing ItemStyle.xsl to display documents in a web part. I need to display the value of a choice field whose name unfortunately contains a forward slash and I don't get it to display its value. So far I tried:

<xsl:value-of select="@Slash_x002f_Column"/>
<xsl:value-of select="Slash_x002f_Column"/>

I even tried to create a variable using

<xsl:variable name="SlashColumn" select="Slash_x002f_Column" />
<xsl:variable name="SlashColumn" select="@Slash_x002f_Column" />

and thus

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

The column has two choices, so nothing too strange. Some attempts even rendered the whole page unusable. What do I need to do? Thank you

  • I don't know what you mean by a "choice field" but if it's an XML (or HTML) element or attribute, then its name can't include a "/" (and if it isn't, then XSLT can't select it). It would help to show us your input. – Michael Kay Aug 14 '17 at 14:17
  • Sorry, I just noticed this is a Sharepoint site so my comment merely betrays my ignorance of Sharepoint. – Michael Kay Aug 14 '17 at 14:19
  • Thank you for your time! I didn't know that XSLT was actually that difficult. – bash.d Aug 15 '17 at 6:26

After a few hours of struggle I finally found the solution to my problem:

<xsl:value-of select="@SlashColumn" />

this means that SharePoint is apparently contracting the internal name and omitting the slash (_x002f_) in the internal field name (Slash_x002f_Column).

What actually happened if I had a field with the internal name SlashColumn?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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