Questions tagged [textnode]

textNodes in DOM, HTML, XML are nodes which contain only text, rather than the other node types of element, comment, and processing instruction.

textNodes in DOM, HTML, XML are nodes which contain only text, rather than the other node types of element, comment, and .

191 questions
0
votes
2 answers

How are empty text-nodes processed?

If i apply the following xslt
Äxel
  • 350
  • 1
  • 17
0
votes
1 answer

How to get the html of a text node in jquery?

I use this as 1 of the many parts in my language translation jquery script. This part grab's the text of a node, as I loop through all the nodes on a web page. However it grab's a lot of the hidden javascript as a text node as well. So is there a…
crosenblum
  • 1,869
  • 5
  • 34
  • 57
0
votes
2 answers

How can we get text node using dom4j

When we parse an XML document like Sometext using Javax.xml.Parsers.DocumentBuilder, we can always get the text node by Document doc = ... Node entry = doc.getFirstChild(); Node textNode = entry.item(0); However, I wonder how…
Dickens LI
  • 11
  • 2
0
votes
3 answers

forcing firefox skip "text nodes" in DOM parsing by javascript

Hi I'm writing a javascript code to traverse HTML dom and highlight elements. My problem is firefox returns whitespaces as text node. Is there any solution to force it to just return tags? for example I need "firstChild" always return first tag and…
Ariyan
  • 14,760
  • 31
  • 112
  • 175
0
votes
1 answer

JavaScript - Appending element node to text node parent

I am trying to add a new element to the parent of a text node, however all my attempts are not working. I want to extract some text from a text node and convert it into a tag, then add that node and the remaining text to the parent of the text…
Samuel Hawksby-Robinson
  • 2,652
  • 4
  • 24
  • 25
0
votes
1 answer

Using jQuery to find matching text in any child text node?

I'm a bit rusty on my jQuery (been a few years!) I have to assume this has been asked 100 times but I'm not searching for the right terms it seems. I'm trying to grab all of the descendant text nodes of an object, and then, if there's a match to a…
DA.
  • 39,848
  • 49
  • 150
  • 213
0
votes
0 answers

JSoup add or replace style to html TextNode

The snip of code below comes from a very large document with all types of tags. I can extract and change things to what I want including working with checkboxes. What I can't seem to do is change and add styles to anything. It does pickup any…
0
votes
1 answer

Jsoup Text Node child

Is it possible for a text node to have children nodes? Or a text node would always be the last child node and the only possible scenario is for it to have sibling nodes?
0
votes
2 answers

Change all textNodes in a page

I am using the following script to change all the text in a page to a long text without spaces "aquickbrownfoxjumpedoveralazyfrog", this is to test if text is breaking gracefully in all places. But when i run the script by pasting it in console, it…
sabithpocker
  • 15,274
  • 1
  • 42
  • 75
0
votes
2 answers

Make selected text a variable & insert it

I have some HTML construct like the following:

Contact

E-Mailsomeone@address.com

Tel.+44 2456-458

physalis
  • 253
  • 4
  • 16
0
votes
1 answer

get textNode with division from div tag

One
Two
Three
Four
var text = $(".list").contents().filter(function() { return this.nodeType == 3;…
Heejoo
  • 3
  • 3
0
votes
1 answer

How to add span elements within text node (document.createTextNode('...')) in JS?

I know that document.createTextNode(text) in JS is for creating text only, but is there a way to insert into it two span elements? I have two spans created like this: /* * span with wrong (old) medical word */ // Replacement node var…
user2670818
  • 719
  • 5
  • 12
  • 28
0
votes
1 answer

Invisible textNodes in the DOM without CSS attributes?

On a LinkedIn profile, there's a box in the right column for "Notify Your Network:" which has invisible text on the label for the switch. This is not the same as the header with a ? I'm regexing the page and trying to figure out how to exclude…
neaumusic
  • 10,027
  • 9
  • 55
  • 83
0
votes
1 answer

Javascript - Cannot Get Parent Of Selected Text After Replacing The Selection

I am trying to get the closest parent element of the selected text, it works if the selected text hasn't been replaced, but it fails after the text replacement. Here is the code (I modified from other source): jQuery(document).ready(function($){ …
Ari
  • 4,643
  • 5
  • 36
  • 52
0
votes
5 answers

How to createText and append text to an existing element e.g. empty span?

Everywhere I've searched I've only found ways to append a textnode after creating a new element. For example, they'll create a new paragraph (p) element, and afterwards they append the textnode to that new paragraph. But I want to add a textnode to…
kensington
  • 27
  • 5