?
Solved

How to replace single quote, when using MSXML parser..?

Posted on 2003-03-19
8
Medium Priority
?
247 Views
Last Modified: 2010-05-18
I am trying to select a node through xpath query, which has the single quote, throwing error.

Appreciate any sort of help.
0
Comment
Question by:rgodavarthi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 9

Expert Comment

by:sparkplug
ID: 8172568
Do you have an example?

>S'Plug<
0
 
LVL 9

Expert Comment

by:sparkplug
ID: 8172723
0
 
LVL 1

Expert Comment

by:xsl-lsx
ID: 8174414
<xsl:stylesheet>

<xsl:param name="q1">'</xsl:param>
<xsl:param name="q2">"</xsl:param>

...
<xsl:attribute name="onmouseover">
     <xsl:text>return !showPopup("nameFieldPopup", event,</xsl:text>
     <xsl:choose>
          <xsl:when test="contains(OBJ_DESC,$q1)">
               <xsl:value-of select="$q2"/>
               <xsl:value-of select="OBJ_DESC"/>
               <xsl:value-of select="$q2"/>
          </xsl:when>
          <xsl:when test="contains(OBJ_DESC,$q2)">
               <xsl:message terminate="yes">
                    has both " and ' within
                    <xsl:value-of select="OBJ_DESC"/>
               </xsl:message>
          </xsl:when>
          <xsl:otherwise>
               <xsl:value-of select="$q1"/>
               <xsl:value-of select="OBJ_DESC"/>
               <xsl:value-of select="$q1"/>
          </xsl:otherwise>
     </xsl:choose>
     <xsl:text>);</xsl:text>
</xsl:attribute>

</xsl:stylesheet>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:rgodavarthi
ID: 8175339
My code:

Node = CurrentSectionNode.selectSingleNode("//Indication[Content = '" + strSelectedContent + "']");

strSelectedContent is string variable, which has single quote.

I'm using MSXML4 parser.

Thanks.
0
 

Author Comment

by:rgodavarthi
ID: 8175363
My code:

Node = CurrentSectionNode.selectSingleNode("//Indication[Content = '" + strSelectedContent + "']");

strSelectedContent is string variable, which has single quote.

I'm using MSXML4 parser.

Thanks.
0
 
LVL 9

Expert Comment

by:sparkplug
ID: 8177971
Try:

strSelectedContent = Replace(strSelectedContent, "'", "&apos;")

>S'Plug<
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12563538
PAQed with no points refunded (of 250)

modulo
Community Support Moderator
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question