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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:00:40+00:00 2026-05-13T10:00:40+00:00

I have the html: <p> <a href=#>click here</a> Welcome </p> And I just want

  • 0

I have the html:

<p>
<a href="#">click here</a>
Welcome
</p>

And I just want to retrieve the “Welcome” part using Xpath combined with the Jaxen lib the Xpath I am using is;

//p/text()

Now when I remove the /text() it retrieves;

click here
Welcome

With the /text() added it retrieve null
Is there any other way to retrieve everything inside the p tag but excluding any other tags?

  • 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-13T10:00:40+00:00Added an answer on May 13, 2026 at 10:00 am

    From the XML parser point of view, there are multiple text elements to choose from (Welcome and the whitespace preceding and following it), so it doesn’t choose any one. You have a few options, mainly stripping the whitespace before parsing or being more specific about the query, like selecting the second most text element:

    //p/text()[2]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make HTML elements clickable using Javascript. Here's what I have: <div
I have been using this code here: $(document).ready(function(){ $('a[href*=#]').bind('click', function(){ var $href = $(this).attr('href')
Suppose on my HTML page I have many href s to a link. Using
I have some html to popup a jQuery UI modal: <a href=my/url class=popup>Click me</a>
Using bootstrap, I have set an example up here: http://fixitup.com.au/clients/bootstrap/issue.html Using scrollto for the
I have an href in HTML that I dynamically produce from a server. I
In menu.html, I have my menu items(a href links), let's call them, menu_1, menu_2,
I have a lot of <a> html tags without the href attribute for making
I have HTML like this: <div> <a href=>sometext<img src=images/001.jpg /></a> <a href=>sometext<img src=images/002.jpg /></a>
I'm trying to modify an object on a click. Here's what I have. <form>

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.