Re: How are char. entity refrences processed by browser?

In SGML (of which HTML is an application) entity references -should- be
passed on to the user agent unprocessed and only processed when printing
them to the page or screen.


It appears that your user agent is doing the correct thing!

Frank

Frank Boumphrey

XML and style sheet info at Http://www.hypermedic.com/style/index.htm
Author: - Professional Style Sheets for HTML and XML http://www.wrox.com
-----Original Message-----
From: Amit Rekhi <amit@abinfosys.com>
To: Style List <www-style@w3.org>
Date: Wednesday, August 05, 1998 5:30 AM
Subject: How are char. entity refrences processed by browser?


>Hello,
>I have 2 code snippets and they have put me in doubt as to how char. entity
>refrences are processed!
>
>CODE SNIPPET 1
>.
>.
>.
><HTML>
>  <HEAD>
>     <SCRIPT LANGUAGE="JSCRIPT"><![CDATA[
>function Temp()
>{
>  var try = "&#38;&#34;";
>  alert(try);
>}
>     ]]></SCRIPT>
>    <TITLE>XSL GENERATED OUTPUT</TITLE>
>  </HEAD>
>  <BODY>
>    <FORM name="ProductForm" OnSubmit="Temp()">
>     <INPUT type="submit" value="SUBMIT FORM"/>
>     <INPUT type="reset" value="CLEAR FORM"/>
>    </FORM>
>  </BODY>
></HTML>
>.
>.
>.
>
>* When temp() is invoked on form submission, I get a dialog box showing me
>"&#38;&#34;" as it is.The text is not replaced by "(double quotes).WHY?
>
>But in code snippet 2, &#34; gets properly substituted by "(double quotes)
>when it is stored in the file temp.txt.
>
>CODE SNIPPET 2
>.
>.
>.
>  <HTML>
>    <FORM name="ProductForm" OnSubmit="
>    var NewFile = new ActiveXObject('Scripting.FileSystemObject');
>    var Response =
NewFile.CreateTextFile(document.all.filename.value,true);
>    var text = '&#34;';
>    Response.Write(text);
>    Response.Close();">
>     <INPUT type="filename" value="c:\temp.txt"/>
>     <INPUT type="submit" value="SUBMIT FORM"/>
>    </FORM>
>  </BODY>
></HTML>
>.
>.
>.
>
>Why is it that in CODE SNIPPET 1 the entitry refrence does not get replaced
>whereas it does in the second case?
>Thanks for any suggestions,
>
>
>        AMIT
>
>
>
>
>
>
>
>
>
>
>

Received on Wednesday, 5 August 1998 10:11:22 UTC