Re: How not to parse HTML??



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: 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)
  • 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: [PHP] generating an html intro text ...
    ... You would have to search out and pull in all closing tags. ... grab 256 characters -- The string. ... html markup should not go towards the string length count, ...
    (php.general)
  • [perl-python] 20050127 traverse a dir
    ... suppose you want to walk into a directory, say, to apply a string ... replacement to all html files. ... So, when ever myfun is called, we need to loop thru the ... # with a recursive "filter" ...
    (comp.lang.perl.misc)