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

  • Home
  • SEARCH
  • 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 8140639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:13:47+00:00 2026-06-06T12:13:47+00:00

I am using http://xpath.online-toolz.com/tools/xpath-editor.php as an online XPath evaluator. I tried a few others

  • 0

I am using http://xpath.online-toolz.com/tools/xpath-editor.php
as an online XPath evaluator. I tried a few others but it’s all the same

I have the following in my xml :-

<?xml version="1.0"?>
<test xmlns="abc">
</test>

Now the XPath queries

/
.

gives me the output :-

<test xmlns="abc">
</test>

However, the queries

test
/test
//test

Do not give me any output at all. I’m doing a very basic mistake but I can’t figure out what. I think it’s got something to do with namespaces but changing the queries to

abc:test

doesn’t help either because it gives an Invalid Expression error.

I’m using http://www.w3schools.com/xpath http://www.tizag.com/xmlTutorial/xpathtutorial.php &
http://oreilly.com/perl/excerpts/system-admin-with-perl/ten-minute-xpath-utorial.html

as my sources for XPath tutorials.

  • 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-06T12:13:49+00:00Added an answer on June 6, 2026 at 12:13 pm

    You have no explicit namespace prefixes in your target file, but you still need to cater for them. You can write

    /*[local-name()='test' and namespace-uri()='abc']
    

    Your “abc” is a namespaceURI, not a namespace prefix. It is probably invalid as most tools will test it for a URI form such as

    http://www.abc.com/
    

    A better file would be:

    <test xmlns="http://www.abc.com">
    </test>
    

    when your query would be:

    /*[local-name()='test' and namespace-uri()='http://www.abc.com/']
    

    I have tested this on your site and it works.

    The form

    abc:test
    

    will depend on a mechanism to set the prefix abc to 'http://www.abc.com/' and there doesn’t seem to be a mechanism on the site

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

Sidebar

Related Questions

I'm using this example to fetch links from a website : http://www.merchantos.com/makebeta/php/scraping-links-with-php/ $xpath =
Im using mechanize to parse http://www.hammacher.com/Category/Default.aspx?uq=Gifts-Under-30&all=True What xpath can I use to get to
I learned the libxml2 from http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html Trying to parsing following html using libxml2: <html><head></head>
Im using http://www.ashberg.de/php-barcode/ scripts to generate a barcode. I now need to import the
I am using http://sharpcompress.codeplex.com/ to compress a directory: using (var archive = ZipArchive.Create()) {
I'm using http://powertools.codeplex.com and/or http://docx.codeplex.com to join word documents. The first document contains a
I am using http://nvie.com/posts/a-successful-git-branching-model/ As far as I understand, main repo in this model
From http://metacpan.org/pod/XML::LibXML::Node : find evaluates the XPath 1.0 expression using the current node as
I'm using VBA to parse the soap xml with MSXML2 and XPath but while
big fan of xpath on .net, and sax in python, but first time using

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.