DOM, how to get text out of text node

Hi all,
i am stack on this:
i am parsing a dom document, i reach a text node, but i can't get the
text out of the text node.
Hope some one can help.
this is the code:

childs is a nsIDOMNodeList.

 	PRUint32 len, i;
        childs->GetLength( &len );
        nsCOMPtr<nsIDOMNode> child;
        nsEmbedString name;
        nsEmbedString value;
        PRUint16 type;
        for( i = 0; i < len; i++ ) {
            childs->Item( i, getter_AddRefs( child ) );
            child->GetNodeType( &type );
            child->GetLocalName( name );

	    // TEXT_NOTE here
            if( type == nsIDOMNode::TEXT_NODE ) {
                httpsec_log( stderr, "%s\n", "TEXT_NODE" );
                nsCOMPtr<nsIDOMText> data = do_QueryInterface( child );
                NS_ENSURE_TRUE( data, NS_ERROR_UNEXPECTED );

                data->GetData( value );
                // there is nothing in value, when i print it
                httpsec_log( stderr, "%s\n", NS_ConvertUTF16toUTF8(
value ).get() );
                data->GetNodeValue( value );
	        // again nothing here
                httpsec_log( stderr, "%s\n", NS_ConvertUTF16toUTF8(
value ).get() );
            }
0
Andrea
5/19/2006 11:43:05 AM
mozilla.dev.tech.xpcom 1345 articles. 0 followers. Post Follow

0 Replies
692 Views

Similar Articles

[PageSpeed] 12

Reply:

Similar Artilces:

How do I get the Text of a Text ....
That may sound confusing, but I need to get the text of a Dynamically created text object. For each row the Text objects text might be somthing different, and when I loop through all the rows, I need to see if any of them are a certain Word. When I used Getitemstring, it doesn't like it. dw_1.Describe( 'text_control.text' ) will give you the .text attribute of a text control in a datawindow. How are you getting different values for the .text attributes on different rows? Using an expression or something? -- Paul Horan[TeamSybase] VCI Springfield, MA www.v...

length or trim ? how can i get textbox.text as text that publichouse to textbox.text as text that public ?
hello friends length or trim ? how can i get textbox.text as text that publichouse to textbox.text as text that public ? second example is ..... textbox1.text is greenhouse.. i want to get green from textbox.text cheer Mark as me if my question or my answer can be helpful for you :) Hi,you can always perform a Trim to a retrieved string to delete the leading and trailing space characters. For your second example where you want to gt a part of the retrieved string you can use the SubString method of the String class.Grz, Kris. Read my blog. Handy Firefox plugins for web developers.Workar...

superreview granted: [Bug 282089] Allow ISimpleDOMNode style retrieval methods to be used on text nodes : [Attachment 174187] Use DOM parent for text node
Johnny Stenback <jst@mozilla.org> has granted Aaron Leventhal <aaronleventhal@moonset.net>'s request for superreview: Bug 282089: Allow ISimpleDOMNode style retrieval methods to be used on text nodes https://bugzilla.mozilla.org/show_bug.cgi?id=282089 Attachment 174187: Use DOM parent for text node https://bugzilla.mozilla.org/attachment.cgi?id=174187&action=edit ...

superreview requested: [Bug 282089] Allow ISimpleDOMNode style retrieval methods to be used on text nodes : [Attachment 174187] Use DOM parent for text node
Aaron Leventhal <aaronleventhal@moonset.net> has asked Johnny Stenback <jst@mozilla.org> for superreview: Bug 282089: Allow ISimpleDOMNode style retrieval methods to be used on text nodes https://bugzilla.mozilla.org/show_bug.cgi?id=282089 Attachment 174187: Use DOM parent for text node https://bugzilla.mozilla.org/attachment.cgi?id=174187&action=edit ...

Text as text
Name: JohnA Boice Email: jaboiceathughesdotnet Product: Firefox Summary: Text as text Comments: You need to do as Safari does and make ALL text, including buttons, links, bookmarks, and general page text actual text so screen readers can interpret and voice the text. Until this occurs, your products are a real pain to use. And I have limited sight. What about those with less or no sight? Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 ...

Copy web text fr FF2 PASTE to outlook text mail msg get an attachment not text
I never had this problem with IE. When I copy text from a web page and try to paste it as text into an Outlook2000 TEXT mail message, it instead is rendered into an attachment to the message. I just want to paste the text. Does anyone know why this happens, better yet - how to fix it? Currently I have to past the text into a text editor, and then recopy that into my Outlook mail message. This is getting old fast. Thanks in advance. Sandalls On 2/23/2007 5:01 PM On a whim, Sandalls pounded out on the keyboard > I never had this problem with IE. > > When I co...

Bold Text For Selected text in Text Box
Hi EveryoneI have a small thing to do [at this time , very big for me]. I want to make some text string as bold which appears in a text box control for the web. It means some of the portion of the string will be bold and some will be in the normal font style. Can anyone suggest any idea to accomplish this task. [I know that we can set the font weight property for the whole text box and all the text appears in the selected font-weight]Any suggestions.BaberBaber SaeedSoftware EngineerPalmChip, Pakistan Toll Free: 0800-000-13 Ext:494Cell: 0300-6438634 Standard TextBox that comes with ASP.NET ...

Text not appearing when typing the text into text field
Name: Maadhavan Email: madhavan_t_patyahoodotcom Product: Firefox Summary: Text not appearing when typing the text into text field Comments: Text not appearing when typing the text into text field or any other field Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

How to get plain text of currently displayed text
I need to get text of currently displayed page from extension. var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var mainWindow = wm.getMostRecentWindow("navigator:browser"); alert(mainWindow.getBrowser().selectedBrowser.contentDocument.getSelection().toString()) This returns only selected text. I need to get all text content but has no glue how to do this. Please help. Alex On Dec 17, 5:15=A0am, dzen <dze...@inbox.ru> wrote: > I need ...

Getting Text Between Two Words In Text File
Hi everyone, Im just wondering what the best way to do this would be.I need to get a certain line of text from a number of text file records.This text lies between "-" and a </strong> tag. How would I go about this Thanks for your help! julie Use the File class to open and read your file and then use Regular Expression to find the specific word. References: File Class Regular Expression "I refuse to sign my posts with some clever quote said by some famous tech head in order to make myself seem more intelligent"-- Bill Gates...

How to get a text from rich text edit control ?
It does not have a such property as 'Text'. So how can I catch in to variable whatever user types ? Thanks. string ls_text this.SelectTextAll() ls_text = this.SelectedText() On Thu, 24 May 2001 11:43:44 -0400, in powersoft.public.powerbuilder.general yt <tyuriy@aol.com> wrote: >It does not have a such property as 'Text'. So how can I catch in to >variable whatever user types ? > >Thanks. > > Bruce Armstrong [TeamSybase] http://www.needhim.org ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_news...

How do I get the left part of a text box.text
How do I get the left part of a text box.text???Something like: textbox1.text.left(3) to get 'abc' if the text box contains the alphabeth.But then the correct way You can do something as: string mainString = "abcdefg....";string strSubString = mainString.SubString(0,2); Hope this helps, RegardsBilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP Use the Substring() method.string tempstring = TextBox1.Text.Substring(0,3); thanks all...

How does text gets displayed in composer text field?
Hi, I'm new to TB dev. I stumbled upon this problem while trying to fix bug 309= 708. I am trying to figure out how does a message gets displayed in the com= poser window? I noticed that when I click edit on a mail in my drafts folde= r, the text in the uncompleted mail is displayed in the composer. I want to= do something similar to this. Does anyone know how does TB copy the text from the mail and display it on = the composer window? Is there like a textField.setText() to put the text into the composer's edi= ting text field? In another words, what function should i ca...

Getting evaluated text value for text objects
I'm attempting to get the visible text value out of a text object in a report. If I describe the .Text attribute, I can get the text out, however, if the value is an expression I get the unevaluated string. I can describe the Evaluate function called with the .Text attribute as the argument, and this will normally return the evaluated text from the element. The problem I have encountered is when you have, for example, a field named "phone" and the text value of the text element is also the word "phone". Calling evaluate on this will replace the word &quo...

Web resources about - DOM, how to get text out of text node - mozilla.dev.tech.xpcom

Text - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Lawsuit against Apple for undelivered texts to Android phones now completely dismissed
Back in August, U.S. District Judge Lucy H. Koh threw out a class action lawsuit against Apple from former iPhone users complaining that text ...

Judge: San Francisco can’t fire cops who exchanged racist and sexist text messages
Enlarge / San Francisco police chief Greg Suhr (L) at a news conference last year. "Anyone capable of the reprehensive texts that these guys ...

5 Types of Texts to Send to Your Partner Every Day
Researchers Lori Schade, Jonathan Sandberg, Roy Bean, and Sarah Coyne found that texting between partners could either help or hurt a relationship. ...

Apple wins complete victory in class-action lawsuit that claimed iMessage was rigged to not deliver texts ...
... has won a complete victory in a lawsuit that claimed the company wiretaps Android users by intercepting, and then failing to deliver, texts ...

Apple wins victory in class-action lawsuit that claimed iMessage was rigged to not deliver texts to Android ...
Apple's iMessage system was notoriously unreliable at delivering texts to Android phones until late 2014, when Apple introduced a fix for the ...

Docs: Texas teacher tried to cover up texts with teen
Haeli Wey, the 28-year-old Austin teacher accused of improper sexual relationships with two teen students, allegedly asked one victim to help ...

Judge rules in Apple’s favor in lawsuit about disappearing Android texts
Apple has claimed final victory in a lawsuit arguing that the company was purposely intercepting and failing to deliver texts sent from iPhones ...

Adobe's new app adds text and graphics to your social posts
To help the less design savvy create graphics for their social posts, Adobe has a new app that's driven by so-called Design Filters. The app ...

Amy (Duggar) King Speaks Out to ET About Parents' Divorce: 'My Dad Told Me Through a Text on Christmas' ...
Amy (Duggar) King Speaks Out to ET About Parents' Divorce: 'My Dad Told Me Through a Text on Christmas'

Resources last updated: 1/3/2016 3:01:02 AM