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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:51:54+00:00 2026-05-22T21:51:54+00:00

I have the following Xml in my Resources.xmltest: <?xml version=1.0 encoding=utf-8 ?> <Response xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

  • 0

I have the following Xml in my Resources.xmltest:

<?xml version="1.0" encoding="utf-8" ?>   
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://DFISofft.com/SmartPayments/">
    <Result>0</Result>
    <Message>Pending</Message>
    <PNRef>222131</PNRef>
    <ExtData>InvNum=123</ExtData>   
 </Response>

I’ve tried several ways to get the values, Result,Message,PNRef,ExtData, out of it and I’ve had no luck. I always get a null value for the NodePath so it never goes into the loop:

  var XmlDoc = new XmlDocument();

  XmlDoc.LoadXml(Resources.xmltest);
  XmlElement NodePath = (XmlElement) XmlDoc.SelectSingleNode("/Response");

  while (NodePath != null)
  {
    foreach (XmlNode Xml_Node in NodePath)
    {
      Console.WriteLine(Xml_Node.Name + " " + Xml_Node.InnerText);
    }
  }

I’ve tried this:

  XmlNode node3 = XmlDoc.SelectSingleNode("PNRef");
  Console.WriteLine(node3.Value);

  Console.WriteLine(XmlDoc.InnerXml);

  var tst = XmlDoc.GetElementsByTagName("PNRef");
  Console.WriteLine(tst);

And this:

  NodePath = (XmlElement) XmlDoc.SelectSingleNode("/Response");

  if (NodePath != null)
  {
    foreach (XmlNode node in NodePath)
    {
      Console.WriteLine("NodeName: " + Xml_NodeX.Name);
      Console.WriteLine("NodeValue: " + node.InnerText);
    }
   }

Apparently, I’m not getting the xml read/write. I’ve done it with DataSets but they do all the work for you.

Can someone point me in the right direction? I’ve been at this for longer than I should have been already.

Thank you!

  • 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-05-22T21:51:55+00:00Added an answer on May 22, 2026 at 9:51 pm

    That is because the node isn’t called response; you need to take the namespace into account:

    var XmlDoc = new XmlDocument();
    var nsmgr = new XmlNamespaceManager(XmlDoc.NameTable);
    nsmgr.AddNamespace("x", "http://DFISofft.com/SmartPayments/");
    XmlDoc.LoadXml(yourXml);
    XmlElement NodePath = (XmlElement)XmlDoc.SelectSingleNode("/x:Response", nsmgr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following XML file: <?xml version=1.0 encoding=UTF-8?> <process name=TestSVG2 xmlns=http://www.example.org targetNamespace=http://www.example.org xmlns:xsd=http://www.w3.org/2001/XMLSchema> <sequence>
I have XML similar to the following <?xml version=1.0 encoding=utf-8?> <foo name=FooBar xmlns=http://mydomain/myapp/ver/myschema.xsd> <bars
I have the following XML: <?xml version=1.0 encoding=UTF-8 standalone=yes?> <application xmlns=http://research.sun.com/wadl/2006/10> <doc xmlns:jersey=http://jersey.dev.java.net/ jersey:generatedBy=Jersey:
In Android project's strings.xml file i have following html text <?xml version=1.0 encoding=utf-8?> <resources>
I have the following XML <?xml version=1.0?> <FileHeader xmlns=urn:schemas-ncr-com:ECPIX:CXF:FileStructure:020001 VersionNumber=020001 TestFileIndicator=P CreationDate=13012009 CreationTime=172852 FileID=0000000001
I am trying to code the following xml by code. ----drawable\my_layerdrawable.xml <?xml version=1.0 encoding=utf-8?>
I have the following XML structure: <?xml version=1.0 ?> <course xml:lang=nl> <body> <item id=787900813228567
I have the following xml I'd like to deserialize into a class <?xml version=1.0
I have the following XML example <?xml version=1.0?> <test> <items> <item>item 1</item> <item>item 2</item>
I have the following test case xaml. <Window.Resources> <XmlDataProvider x:Key=testDS1> <x:XData> <root xmlns=> <item>1</item>

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.