nodevalue

How do I choose between innerText or nodeValue?

Hi, When I need to change a text within a span element, which one should I use and what is the difference: var spnDetailDisplay=document.getElementById('spnDetailDisplay'); spnDetailDisplay.innerText=sDetail; or var spnDetailDisplay=document.getElementById('spnDetailDisplay'); spnDetailDisplay.childNodes[0].nodeValue=sDetail; ...

nodeValue from DomDocument returning weird characters in PHP

So I'm trying to parse HTML pages and looking for paragraphs (<p>) using get_elements_by_tag_name('p'); The problem is that when I use $element->nodeValue, it's returning weird characters. The document is loaded first into $html using curl then loading it into a DomDocument. I'm sure it has to do with charsets. Here's an example of a ...

Get content from XML PHP5

Hi, I´m working on a paymentsolution and need some help with the PHP. I´m doing a HTTPRequest and in response I will get some XML. The XML Could look like this: <?xml version="1.0" encoding="utf-8" ?> <payer> <purchase_list> <freeform_purchase> <line_number>1</line_number> <description>d...

ASP.NET Web Service returning XML result and nodevalue is always null

I have an ASP.NET web service which returns an XMLDocument. The web service is called from a Firefox extension using XMLHttpRequest. var serviceRequest = new XMLHttpRequest(); serviecRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); I consume the result using responseXML. So far so good. But when I iterate throu...

how to get the 'guid's nodeValue in my code using google ajax feed api.

this is my code : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google AJAX Feed API - Simple Example</title> <!--<script type=...

I want to extract the contents of a node as a string using XPath and PHP

Hi, I have a function that accepts a general HTML file and a general XPath expression. I want to extract a string of the matched node containing the entire text including HTML tags. Here's a simplified example... <?php $inDocStg = " <html><body> <div>The best-laid<br> schemes o' <span>mice</span> an' men <img src='./mous...

Grab any Text Node within the BODY using Jquery

Hoping someone can help. I need to grab any text node inside the body. Even if it is NOT contained within any other element. I've tried: $("p, div, html, body").each(function(){ $(this).contents().filter(function() { var regExText = /(\w|\d|,|;|&)/; if (this.nodeType == 3 ...

Javascript nodeValue returns null

Title should make my problem well described.Here goes my code. <div id="adiv"><text>Some text</text></div> <script type="text/javascript"> function vb(){ alert(document.getElementById("adiv").firstChild.nodeValue); //returns null } </script> <input type="button" onclick="vb();" value="get"/> wheres the problem..? ...