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 8664983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:22:19+00:00 2026-06-12T17:22:19+00:00

I’ve the following XML structure which is a part of a xml document: <p:sp

  • 0

I’ve the following XML structure which is a part of a xml document:

<p:sp xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
....
....
....
<p:txBody>
 <a:bodyPr wrap="square" rtlCol="0" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:noAutofit />
 </a:bodyPr>
 <a:lstStyle xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" />
 <a:p xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
   <a:endParaRPr lang="en-US" sz="1200" dirty="0">
   <a:solidFill><a:schemeClr val="tx1" />
   </a:solidFill>
   <a:latin typeface="Verdana" pitchFamily="34" charset="0" />
   <a:ea typeface="Verdana" pitchFamily="34" charset="0" />
   <a:cs typeface="Verdana" pitchFamily="34" charset="0" /></a:endParaRPr>
 </a:p>
</p:txBody>
</p:sp>

I want to select p:txBody and want to inject a:p at the end, I’m using the following code but the txBody i am receiving is not the correct one, because i guess it’s extracting that from the doc object not from the shape object:

        XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
        nsmgr.AddNamespace("p", "http://schemas.openxmlformats.org/presentationml/2006/main");
        XmlNode txBody = shape.SelectSingleNode("//p:txBody", nsmgr);

where shape is an XMLNode object having the OuterXml as mentioned above, and using the following code for xml injection:

        XmlDocumentFragment fragment = doc.CreateDocumentFragment();
        string xml = "valid xml";
        fragment.InnerXml = xml;
        txBody.Append(fragment);

but the injection is being done in wrong shape.

  • 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-12T17:22:21+00:00Added an answer on June 12, 2026 at 5:22 pm

    Your xpath isn’t specific enough if it is getting you the wrong node. You need to give it more information to get the node you want. IE what sets the node you want to be different than the other(s)?

    As you have it now, you are saying give me the first node you find that has the p namespace and the node name txBody anywhere in the file.

    You have shape. but the // in "//p:txBody" says start from the root of the file. If you mean to start from the shape, use .// so like ".//p:txBody"

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

Sidebar

Related Questions

I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.