I have a SharePoint list that contains a URL field. I use an XSL stylesheet to iterate the list and populate a page with links. I encountered a URL which was longer than 255 characters, which is the limit in SharePoint. I saw this link (hyperlink-columns-does-not-allow-more-than-255.html) and created a multiline column to contain the URL. I modified my XSL stylesheet to use the new field, but it is not working. It is not returning the URL. The name of the multiline field was called LongURL.
Here is the xsl style sheet that works with the URL field:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
<!-- This is the actual wrapper element that will be emitted -->
<div><img src="/sites/abc/Images/Organization_Dashboards.png" border="0" alt="Org"/>
<!-- This will tell the data view to look for the actual content
and come back when it's done. -->
<xsl:apply-templates/>
</div>
<!-- end wrapper -->
</xsl:template>
<xsl:template match="/dsQueryResponse/Rows/Row">
<!-- This markup is used for each item in the list -->
<ul style="list-style-position: outside;padding:0;margin:0"><li style="list-style-type:none;padding:0;margin:0;">
<a href="{@URL}" target="_blank" style="font-size:14px;">
<xsl:value-of select="@URL_x0020_Name" disable-output-escaping="yes"/></a></li></ul>
</xsl:template>
</xsl:stylesheet>
When I change the a href to @LongURL the main site returns, not where the long url is pointing too.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
<!-- This is the actual wrapper element that will be emitted -->
<div><img src="/sites/abc/Images/Organization_Dashboards.png" border="0" alt="Org"/>
<!-- This will tell the data view to look for the actual content
and come back when it's done. -->
<xsl:apply-templates/>
</div>
<!-- end wrapper -->
</xsl:template>
<xsl:template match="/dsQueryResponse/Rows/Row">
<!-- This markup is used for each item in the list -->
<ul style="list-style-position: outside;padding:0;margin:0"><li style="list-style-type:none;padding:0;margin:0;">
<a href="{@LongURL}" target="_blank" style="font-size:14px;">
<xsl:value-of select="@URL_x0020_Name" disable-output-escaping="yes"/></a></li></ul>
</xsl:template>
</xsl:stylesheet>
Is there anything I can do to get the Stylesheet to pull the LongURL correctly?