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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:25:23+00:00 2026-05-17T01:25:23+00:00

I should be doing something wrong. What is the XPath query for all nodes

  • 0

I should be doing something wrong. What is the XPath query for all nodes named “name” under display-name? I am using libxml2.

<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006"  xmlns:xlink="http://www.w3.org/1999/xlink">
    <version value="2010.05.25" />
    <identifier value="German.frami2006DE.dictionary.from.org.openoffice.de.by.Karl.Zeiler" />
    <display-name>
        <name lang="en">German (DE-frami) spelling, hyphenation, thesaurus</name>
        <name lang="de">Deutsche (DE-frami) Rechtschreibung, Trennung, Thesaurus</name>
    </display-name>
    <platform value="all" />
    <dependencies>
        <OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0" />
    </dependencies>
</description>
  • 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-17T01:25:23+00:00Added an answer on May 17, 2026 at 1:25 am

    Your document has a default namespace, so you need to register that namespace in your expression. I’ve never used libxml2, but looking at their examples, it would appear that the function you want is xmlXPathRegisterNs

    Note that when you register a namespace, the prefix that you choose for your XPath expression doesn’t have to match the prefix (if any) used in the document. Since you’re document uses a default namespace (not prefix), it definitely won’t. However, you still need to use a prefix in your XPath:

    /ns:description/ns:display-name/ns:name

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

Sidebar

Related Questions

what am I doing wrong in this code.. I should get the class name
I must be doing something wrong here, any ideas? >>> (datetime.datetime(2008,11,7,10,5,14)-datetime.datetime(2008,11,6,9,30,16)).seconds 2098 It should
I thought this markup should work, but it I must be doing something wrong.
This should so work. Please tell me I'm doing something wrong. Here's the code:
somewhere I'm doing something wrong, my query results to true instead of false. In
Not sure if I could be doing something wrong, or if I should just
I'm using cocos2d for iOS. Not sure if I'm doing something wrong here or
I'm not sure what I'm doing wrong, but two versions of code that should
When using git submodules, what is the preferred way of doing customizations? Should I...
I don't know if I'm doing something wrong or right, but when I'm debugging

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.