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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:32:08+00:00 2026-06-18T14:32:08+00:00

I am trying to learn XPath, and finding it difficult, as I am Googling

  • 0

I am trying to learn XPath, and finding it difficult, as I am Googling my way through it all.
Here is my XML:

<?xml version="1.0" encoding="utf-8"?>
    <details>
        <signature id="sig1">
            <name>mr. Barry Smith</name>
            <telephone type="fixed">01234 123456</telephone>
            <telephone type="mobile">071234562</telephone>
        </signature>

        <signature id="sig2">
            <name>mr. Harry Smith</name>
            <telephone type="fixed">01234 123456</telephone>
        </signature>
    </details>

How can I find the names of people who have a mobile phone, I can get either or, but not both.

I have been trying things like this:

staffdetails/signature/telephone[@type='mobile']name

Also, is there a reference guide for using XPAth, so I can easily figure out any query I wish? Using online tutorials I have found explain how XPath works, but the examples don’t cover enough.

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-06-18T14:32:09+00:00Added an answer on June 18, 2026 at 2:32 pm

    This should work:

    //signature/name[following-sibling::telephone[@type='mobile']]
    

    It reads as:

    Select any name that has a signature parent and a telephone sibling which type = mobile.

    Regarding the reference, I actually learnt the most from the examples in the spec!

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

Sidebar

Related Questions

I'm trying to learn XPath. I looked at the other contains() examples around here,
So i'm trying to learn some xml parsing here, and I'm getting the hang
Trying to learn a bit about PDO and is going through this tutorial .
Trying to learn C++ and working through a simple exercise on arrays. Basically, I've
Trying to learn some F# and I've run into a couple of hangups. Here's
Am trying to learn Python the Atlantic way and am stuck on Project Euler
I trying to learn BDD way for development and just watched RailsCasts lesson for
im just trying to learn xpath when i have a small question. let's say
I'm just starting to learn Xpath, I'm trying to write a line of code
I'm trying to learn how to do XPath queries from Python using this sample

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.