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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:34:29+00:00 2026-06-08T14:34:29+00:00

Consider the snippet of HTML for a web page given below– <div id=divText>Text 1

  • 0

Consider the snippet of HTML for a web page given below–

<div id="divText">Text 1
    <div id="divText1_1">Text 1_1</div>
    <div id="divText1_2">Text 1_2</div>
    <div id="divText1_3">Text 1_3</div>
    <div id="divText1_4">Text 1_4</div>
</div>

Now, if a user has selected the first 2 divs within the outer div (i.e. “Text 1_1” and “Text 1_2”), then there are nodes corresponding to the 2 divs -i.e. divText1_1 and divText1_2, also there are 2 text nodes for the 2 text snippets selected by the user.

However, in addition to these nodes (2 text and 2 divs ) there is also one more text node, that occurs before the second div node. From what I understand, because there are spaces after the end of first inner div and before the second outer div, this space is also considered as a text node by the browser.

What I want to know is, how do I filter out such nodes? In other words, what are all the possible values for such text nodes? null/ “”/ ” “/ other values? I would like to know all possible values so that I can correctly filter out such nodes

  • 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-08T14:34:33+00:00Added an answer on June 8, 2026 at 2:34 pm

    Text nodes always have a string as their value. If you want to filter out text nodes only containing white space characters, then you can trim the value and compare it against the empty string.

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

Sidebar

Related Questions

Consider the following snippet: import lxml.html html = '<div><br />Hello text</div>' doc = lxml.html.fromstring(html)
Consider the following html snippet <!DOCTYPE html> <html> <head> <script type=text/javascript src=http://code.jquery.com/jquery-1.4.2.js ></script> <script
Consider the following HTML snippet: <p>Space&nbsp;Test</p> When this HTML is used in a web
Consider the following HTML snippet. The desired effect is to have a dropdown be
Consider the following HTML snippet containing some javascript utilizing prompt and unload . The
Consider the following HTML snipped: <input type=submit value=Delete selected><input type=submit value=Print selected> <div class=table>
Consider this snippet: <div> <span style=color:red;>a</span> <span style=color:blue;>a</span> <span style=color:white;>a</span> </div> How can you
I am having a problem using $html->link helper in my view. Consider this snippet...
Please consider this HTML and CSS snippet: #container { border: 1px solid red; height:
Consider this small snippet of JavaScript: for(var i in map.maps) { buttons.push($(<button>).html(i).click(function() { alert(i);

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.