Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Sat May 25, 2013 1:38 am

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Special character in XSL Contain
PostPosted: Thu Dec 02, 2010 5:29 pm 
Offline

Joined: Mon Jan 04, 2010 12:41 pm
Posts: 245
Hi,

I have a DVWP XSL to receive related data from second list for the first list. However I see that some records are not pulled when it contains characters like / or (.
Here is the code being used to filter DVWP

Code:
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[contains($DItems,@Line_x002d_Item)]"/>


The Line_x002d_Item parameter has names which are not pulled e.g. (None), Tasters N/A

We have lot of them like <NAME> N/A format which are not pulled. Any suggestions?


Top
 Profile  
 
 Post subject: Re: Special character in XSL Contain
PostPosted: Thu Dec 09, 2010 3:12 pm 
Offline

Joined: Mon Jan 04, 2010 12:41 pm
Posts: 245
Dos any one has answer to this? Please help.


Top
 Profile  
 
 Post subject: Re: Special character in XSL Contain
PostPosted: Thu Dec 09, 2010 3:58 pm 
Offline
User avatar

Joined: Sat Jan 02, 2010 6:02 pm
Posts: 1035
Location: Silver Spring, MD
I think you may have to escape these characters. Here's a sample template that you can build upon and modify to suit your needs.

Code:
<xsl:template name="FixAmpersands">
<xsl:param name="StringValue"/>
<xsl:variable name="Ampersand" select="'&amp;'" />
<xsl:choose>
<xsl:when test="contains($StringValue, $Ampersand)">
<xsl:value-of select="concat(substring-before($StringValue, $Ampersand), '&amp;amp;', substring-after($StringValue, $Ampersand))"/>
<xsl:when>
<xsl:otherwise>
<xsl:value-of select="$StringValue"/>
<xsl:otherwise>
<xsl:choose>
<xsl:template>

Also, if you come up with something you'd like to share, post it over to the SPXSLT project.


Top
 Profile  
 
 Post subject: Re: Special character in XSL Contain
PostPosted: Thu Mar 31, 2011 1:34 am 
Offline

Joined: Mon Jan 04, 2010 12:41 pm
Posts: 245
I have found an interesting and odd issue with XSLT Contains() function:

e.g. I have two lists, where one has a lookup to others column with mutiple values allowed. In the lookup field data I have many items with name like MSTR(ver TBD) and others like that i.e. with bracket.
Now when I have such items selected in lookup and when there is only one lookup value the more details view at the bottom for that item doesn't render. However, if I have >1 lookup items and the () items are not last then view renders fine with details but again if it is at last then doesn't render.

Strange issue....does anyone know what to do?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group