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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:48:47+00:00 2026-05-27T16:48:47+00:00

<?xml version=1.0 encoding=UTF-8 standalone=yes?> <w:document xmlns:ve=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:o=urn:schemas-microsoft-com:office:office xmlns:r=http://schemas.openxmlformats.org/officeDocument/2006/relationships xmlns:m=http://schemas.openxmlformats.org/officeDocument/2006/math xmlns:v=urn:schemas-microsoft-com:vml xmlns:wp=http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing xmlns:w10=urn:schemas-microsoft-com:office:word xmlns:w=http://schemas.openxmlformats.org/wordprocessingml/2006/main xmlns:wne=http://schemas.microsoft.com/office/word/2006/wordml>

  • 0
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <w:document xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
    <w:body>
      <w:customXml w:uri="Sample" w:element="note">
        <w:p w:rsidR="00B06944" w:rsidRDefault="0051608D" w:rsidP="000E0B9F">
          <w:customXml w:element="to">
            <w:r w:rsidR="000E0B9F" w:rsidRPr="00B84BAE">
              <w:rPr>
                <w:b/>
                <w:bCs/>
              </w:rPr>
              <w:t xml:space="preserve">Saran </w:t>
            </w:r>
          </w:customXml>
        </w:body>
     </w:document>

as I want to read the node < w:r >
for this i am writing the below code

XmlDocument doc = new XmlDocument();
doc.Load("\\document.xml");
XmlNamespaceManager namespaceManager = new XmlNamespaceManager(doc.NameTable);
XmlNode node = doc.SelectSingleNode("/w:body/w:customXml/w:r", namespaceManager);

which gives:

The error shown in this line is Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.

How can I read the Xml

  • 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-27T16:48:48+00:00Added an answer on May 27, 2026 at 4:48 pm

    You need to tell namespaceManager about the meaning of the alias w. It sounds like this is redundant (from the file), but it is not the case that the aliases you want for query are necessarily those from the source, since the meaning of the file is identical if I replace all the w aliases in the source document with foo (as long as I also define foo:xmlns to the be same). Or I could use xmlns instead of aliases throughout.

    Hence:

    XmlNamespaceManager namespaceManager = new XmlNamespaceManager(doc.NameTable);
    namespaceManager.Add("w",
        "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    XmlNode node = doc.SelectSingleNode("/w:body/w:customXml/w:r", namespaceManager);
    

    This allows your query to succeed identically, regardless of the specific aliases used in the source.

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

Sidebar

Related Questions

This is XML Document. <?xml version=1.0 encoding=UTF-8 standalone=yes?> <w:document xmlns:w=http://schemas.openxmlformats.org/wordprocessingml/2006/main> <w:body> <w:p> <w:pPr> <w:pStyle
This is my XML Document. <?xml version=1.0 encoding=UTF-8 standalone=yes?> <w:document xmlns:w=http://schemas.openxmlformats.org/wordprocessingml/2006/main> <w:body> <w:p> <!--
This is my XML Document(Small Snippt). <?xml version=1.0 encoding=UTF-8 standalone=yes?> <w:document xmlns:w=http://schemas.openxmlformats.org/wordprocessingml/2006/main> <w:body> <w:p>
This is my XML document <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:v="urn:schemas-microsoft-com:vml"> <w:body> <w:p>
I need so generate XML like the following: <?xml version=1.0 encoding=UTF-8 standalone=yes?> <urlset xmlns=http://www.sitemaps.org/schemas/sitemap/0.9
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:
Source xml file: <?xml version=1.0 encoding=UTF-8 standalone=yes?> <!-- Inbound Message --> <Sales xmlns=abc:org.xcbl:schemas/xcbl/v4/xcbl4.xsd xmlns:SOAP-ENV=http://www.w3.org/2003/05/soap-envelope
I have the following XML structure: <?xml version=1.0 encoding=utf-8 standalone=yes?> <Root xmlns:xsi=My Program> <NotRoot
String newpage = <?xml version='1.0' encoding='UTF-8' standalone='yes'?> <!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>
I have an XML File that looks like this: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>

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.