Re: How to -> Add in for IE?

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 05/20/04


Date: Thu, 20 May 2004 10:41:04 -0400


"harvinder singh" <nospam@itppppps.com> wrote in message
news:c8hudu$b2p$1@news.mch.sbs.de
> I got into another problem, I am not been able to figure out a API
> which provides me a text of a node.
> i.e.
> <P>This is a <B>great</B> world </P>
>
> If i use IHTMLElement.innerText I get "This is a great world ", Is
> there any method which would give me a string
> "This is a world ".

I wonder why you would want to. Anyway, you can use innerHTML to get the
HTML contents of the node and then strip nested tags. Or, you can use
Text Markup Services (see IMarkupServices, IMarkupPointer) - these allow
you to move over the contents of an element one "piece" at a time, where
a piece may be a text fragment or a nested tag. I don't know much about
the latter beyond the fact that it exists though.

-- 
With best wishes,
    Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken