Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7770853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:30:32+00:00 2026-06-01T16:30:32+00:00

Could someone help me with this. I need in C# to remove node xsl:variable

  • 0

Could someone help me with this. I need in C# to remove node “xsl:variable” , as you can see here are two xsl:template nodes with child elements xsl:variable . In this sample I need to remove it with C#.

Something like this:

XmlDocument d = new XmlDocument();
d.Load("MyFileName.Xml");
XmlNode t = d.SelectSingleNode("/navigation/page[@id='1']");
t.ParentNode.RemoveChild(t);
d.Save();

But I cant get path of ‘xsl:variable’ to d.SelectSingleNode()

Please help me ?

THIS IS XSLT:

<xsl:template name="Aggregate:RealECBooleanToXMLBoolean">
        <xsl:param name="RealECBoolean" select="/.."/>
        <xsl:variable name="var1_result">
            <xsl:value-of select="($RealECBoolean = 'Yes')"/>
            <xsl:value-of select="($RealECBoolean = 'YES')"/>
            <xsl:value-of select="($RealECBoolean = 'X')"/>
        </xsl:variable>
        <xsl:variable name="var2_resultof_any" select="boolean(translate(normalize-space($var1_result), 'false0 ', ''))"/>
        <xsl:choose>
            <xsl:when test="string((string((string($var2_resultof_any) != 'false')) != 'false')) != 'false'">
                <xsl:value-of select="(string((string($var2_resultof_any) != 'false')) != 'false')"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="false()"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="Aggregate:LookupRECodeName">
        <xsl:param name="RECode" select="/.."/>
        <xsl:call-template name="vmf:vmf1_inputtoresult">
            <xsl:with-param name="input" select="$RECode"/>
        </xsl:call-template>
    </xsl:template>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:30:34+00:00Added an answer on June 1, 2026 at 4:30 pm

    You need to passs to SelectNodes or SelectSingleNode a name space manager defining the xsl prefix:

    XmlNamespaceManager namespaceManager = new XmlNamespaceManager(xDoc.NameTable);
    namespaceManager.AddNamespace("xsl" , "http://www.w3.org/1999/XSL/Transform");
    

    and then:

    XmlNode variableNode = xDoc.SelectSingleNode("//xsl:variable", namespaceManager);
    

    will select the first xsl:variable element, or

    XmlNodeList variableNodes = xDoc.SelectNodes("//xsl:variable", namespaceManager);
    

    will select all xsl:variable elements

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone please help explain why I can't get this to work? I properly
please could someone help me with this. I can't seems to get my mind
Could someone please help me with this? I need to convert an nchar column
Can someone help me to see what is going wrong with this setup I
could someone help me on this problem, i want to access facebook API through
Could someone help me on this, I have created simple web services using axis2
Could someone help me understand the primitive accessors with this example : i don't
I was wondering if someone could help me with this. I have defined my
I would be very grateful if someone could help me with this. I have
I was wondering could someone please help me implemenrt this method whereas I dont

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.