Encoding Encoded Characters in XSLT for Deployment


Let’s say you are deploying out some pages, which may include some custom forms out to a list. In that case, it is pretty straight forward (example: http://www.3guysonsharepoint.com/?p=1004), just do a find and replace in your XLST for < and >, and replace with &lt; and &gt; respectively, paste it within the XSL property (<property name="Xsl" type="string">).

One thing that may trip you up, is if you actually need to keep a < or > sign in your XSLT – but, you cannot deploy the code with that, or else you’ll run into issues…

The fix? Quite simple, just encode the encoded characters, changing the ampersand (&) to &amp;lt; and &amp;gt;, also respectively.

About these ads

About Geoff Varosky
Geoff Varosky is the Director of Development and Evangelism for Jornata (www.jornata.com), a Microsoft Gold Partner focusing on SharePoint solutions based out of Boston, MA. He has been architecting and developing web based applications for over 13 years, and has been working with SharePoint for the past 6 years. Geoff is an active member of the SharePoint community, Co-Founder and Co-Organizer of the Boston Area SharePoint Users Group (www.bostonsharepointug.org), co-organizer for SharePoint Saturday Boston (www.sharepointsaturday.org/boston) and speaks regularly at SharePoint events and user groups.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 61 other followers

%d bloggers like this: