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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:10:44+00:00 2026-06-11T11:10:44+00:00

I try to parse this XML file (config file from Chirpy ): <?xml version=1.0

  • 0

I try to parse this XML file (config file from Chirpy):

<?xml version="1.0" encoding="utf-8" ?>
<root xmlns="urn:ChirpyConfig" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ChirpyConfig http://www.weirdlover.com/chirpy/chirp.xsd">
     <FileGroup Name="Built.debug.js" Minify="false">
        <File Path="jquery/jquery-1.7.2.js"/>
        <File Path="jquery.address/jquery.address-1.4.js"  />
    </FileGroup>
</root>

with this code:

var path = Server.MapPath("~/Scripts/ScriptfilesMashup.chirp.config");
var file = new XPathDocument(path);
var nav = file.CreateNavigator();
var nodes = nav.Select("/root/FileGroup/File");

but nodes is always empty, regardless of how I call the nav.Select method. I barely used XPath before so maybe I’m doing it wrong – but what? Only the selector * gives me the root node.

What would be the selector to get the Path Attribute of all File nodes?

EDIT: SOLUTION

Thanks to Kirill, the final solution looks like this:

var path = Server.MapPath("~/Scripts/ScriptfilesMashup.chirp.config");
var file = new XPathDocument(path);
var nav = file.CreateNavigator();
var ns = "urn:ChirpyConfig";

XmlNamespaceManager nsMgr = new XmlNamespaceManager(nav.NameTable);
nsMgr.AddNamespace("x", ns);

var nodes = nav.Select("/x:root/x:FileGroup/x:File/@Path", nsMgr);    
while(nodes.MoveNext())
{
    var path = nodes.Current.Value;
}
  • 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-11T11:10:46+00:00Added an answer on June 11, 2026 at 11:10 am

    It is because elements root, FileGroup and File are defined in urn:ChirpyConfig namespace.

    Use this:

    XPathDocument xmldoc = new XPathDocument(xmlFile);
    XPathNavigator nav = xmldoc.CreateNavigator();
    XmlNamespaceManager nsMgr = new XmlNamespaceManager(nav.NameTable);
    nsMgr.AddNamespace("x", "urn:ChirpyConfig");
    XPathNavigator result = nav.SelectSingleNode("/x:root/x:FileGroup/x:File", nsMgr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets consider this xml file : <?xml version=1.0 encoding=UTF-8?> <root attribute=value> <element>myElement</element> </root> I'm
I have an XML file like this: <?xml version=1.0 encoding=utf-8?> <RootElement> <Achild> ..... </Achild>
My Xml File looks like this: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE pointList SYSTEM point.dtd> <pointList>
maybe this is a n00b-question. I try to parse an xml-file like that: <?xml
I try to parse articles from wikipedia. I use the *page-articles.xml file, where they
I am trying to parse an XML file. This is the file: <root> <entry>
I have the following XML file: <?xml version=1.0 encoding=utf-8 ?> <strategies> <strategy name=God Class>
I'm try to parse this xml, but c# keeps throwing an exception saying it
I have a JSON which I get from web application. I try this parse
I have a xml file which contains arabic characters.When i try to parse a

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.