Re: How not to parse HTML??



I am creating the page using DHTML and JavaScript.
The page displays data taken from the object model of another application.
Some of this data may contain HTML tags. I need to ignore them.


"Leonhardt Wille" <lwille@xxxxxxxxxx> wrote in message
news:O%23dz%23rgPFHA.4052@xxxxxxxxxxxxxxxxxxxxxxx
> How is the page generated? Do you use PHP for generation? You could just
> call htmlentities (http://de.php.net/manual/en/function.htmlentities.php).
> That's it. If you are using another language, just replace "<" and ">"
> with their HTML equivalents.
>
> Karl R. B. Jones wrote:
>> Hi Leo,
>>
>> I am creating the HTML page dynamically, and don't know in advance what
>> the string will be.
>> I cannot format it in advance. It may contain anything.
>> I need to tell the parser to display it as it is without responding to
>> any tags it may contain.
>>
>> Thanks
>> Karl
>>
>> "Leonhardt Wille" <lwille@xxxxxxxxxx> wrote in message
>> news:eAD0UffPFHA.2956@xxxxxxxxxxxxxxxxxxxxxxx
>>
>>>1. Where do you want to display a string
>>>2. The string may contain HTML, but you don't want it to be parsed? You
>>>have to mask HTML characters like this:
>>>Replace < with &lt; ("lower than")
>>>Replace > with &gt; ("greater than")
>>>Replace " with &quot; ("Quote")
>>>3. I'm having problems understanding your English
>>>
>>>regards Leo
>>>
>>>Karl R. B. Jones wrote:
>>>
>>>>Hi,
>>>>
>>>>Could someone tell me how to display a string without risking any HTML
>>>>that string contains being parsed.
>>>>I want to show text that may contain HTML.
>>>>
>>>>Thanks
>>>>Karl
>>
>>

.



Relevant Pages

  • Re: Lots of Response.Writes of HTML - How do YOU do it?
    ... Dimension array ... // and creates a long html string accordingly to display the info. ...
    (microsoft.public.inetserver.asp.general)
  • Re: $_POST case sensitivity
    ... to me if you are iterating over the data received from a HTML ... However, off topic of course, you can use htmlentities to ... Once you're happy the string is valid, you use one or the other to display the data. ...
    (comp.lang.php)
  • Re: How not to parse HTML??
    ... I need to tell the parser to display it as it is without responding to any ... Where do you want to display a string ... The string may contain HTML, but you don't want it to be parsed? ... > Karl R. B. Jones wrote: ...
    (microsoft.public.inetsdk.html_authoring)
  • Re: How not to parse HTML??
    ... Fabrice ... > Could someone tell me how to display a string without risking any HTML ...
    (microsoft.public.inetsdk.html_authoring)
  • Re: getAttribute question
    ... oddity with IE that getAttributereturns an empty string if the ... HTML specification, ... appropriate places in the HTML 4 and DOM HTML specifications. ...
    (comp.lang.javascript)

Loading