Click here to get back home

tags removed from source code

 HomeNewsGroups | Search
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
tags removed from source code twiggy182 01-06-2009
Posted by twiggy182 on January 6, 2009, 10:47 am
Please log in for more thread options
Hi,

for some reasons, with the "Web Developper bar" in Firefox, I
discovered that there are differences between the "Source code" and
the "Generated source code" in my application.

The main difference is that all my "</option>" tags are missing in the
"Source code". Because of that, the "<optgroup>" tag isn't recognized
at all in IE ( "</option>" tags are also missing in IE when I view the
source code ).

Source code:
<select>
        <optgroup label="My group">
                <option value="1">A
                <option value="2">B
                <option value="3">C
                <option value="4">D
        </optgroup>
</select>

Generated source code:
<select>
        <optgroup label="My group">
                <option value="1">A</option>
                <option value="2">B</option>
                <option value="3">C</option>
                <option value="4">D</option>
        </optgroup>
</select>

So can someone tell me why both FF and IE remove these closing tab?

Another strange thing I noticed: I copied the "Generated source code"
and put it in a new file, and if I open the file in FF or IE,
everything is working well. So I don't understand when this kind of
filtering is applied. Anyone know?

So thanks in advance for any help you could give me.

Posted by Harlan Messinger on January 6, 2009, 11:21 am
Please log in for more thread options
twiggy182 wrote:
> Hi,
>
> for some reasons, with the "Web Developper bar" in Firefox, I
> discovered that there are differences between the "Source code" and
> the "Generated source code" in my application.
>
> The main difference is that all my "</option>" tags are missing in the
> "Source code". Because of that, the "<optgroup>" tag isn't recognized
> at all in IE ( "</option>" tags are also missing in IE when I view the
> source code ).
>
> Source code:
> <select>
>         <optgroup label="My group">
>                 <option value="1">A
>                 <option value="2">B
>                 <option value="3">C
>                 <option value="4">D
>         </optgroup>
> </select>
>
> Generated source code:
> <select>
>         <optgroup label="My group">
>                 <option value="1">A</option>
>                 <option value="2">B</option>
>                 <option value="3">C</option>
>                 <option value="4">D</option>
>         </optgroup>
> </select>
>
> So can someone tell me why both FF and IE remove these closing tab?

I don't understand. You are showing that the browser is *adding* the
closing tags. The "source code" is the code received by the browser. The
"generated source code" is what the browser spits out when it recreates
a well-formed HTML document from its in-memory DOM tree (that is, its
internal representation of the document).

> Another strange thing I noticed: I copied the "Generated source code"
> and put it in a new file, and if I open the file in FF or IE,
> everything is working well. So I don't understand when this kind of
> filtering is applied. Anyone know?

What do you mean by "filtering"? Naturally the page looks the same.
You're feeding the browser exactly the same code that it considered to
be equivalent to the DOM tree it built the first time around.

Posted by twiggy182 on January 6, 2009, 11:40 am
Please log in for more thread options
wrote:
> twiggy182 wrote:
> > Hi,
>
> > for some reasons, with the "Web Developper bar" in Firefox, I
> > discovered that there are differences between the "Source code" and
> > the "Generated source code" in my application.
>
> > The main difference is that all my "</option>" tags are missing in the
> > "Source code". Because of that, the "<optgroup>" tag isn't recognized
> > at all in IE ( "</option>" tags are also missing in IE when I view the
> > source code ).
>
> > Source code:
> > <select>
> > =A0 =A0<optgroup label=3D"My group">
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"1">A
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"2">B
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"3">C
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"4">D
> > =A0 =A0</optgroup>
> > </select>
>
> > Generated source code:
> > <select>
> > =A0 =A0<optgroup label=3D"My group">
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"1">A</option>
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"2">B</option>
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"3">C</option>
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"4">D</option>
> > =A0 =A0</optgroup>
> > </select>
>
> > So can someone tell me why both FF and IE remove these closing tab?
>
> I don't understand. You are showing that the browser is *adding* the
> closing tags. The "source code" is the code received by the browser. The
> "generated source code" is what the browser spits out when it recreates
> a well-formed HTML document from its in-memory DOM tree (that is, its
> internal representation of the document).
>
> > Another strange thing I noticed: I copied the "Generated source code"
> > and put it in a new file, and if I open the file in FF or IE,
> > everything is working well. So I don't understand when this kind of
> > filtering is applied. Anyone know?
>
> What do you mean by "filtering"? Naturally the page looks the same.
> You're feeding the browser exactly the same code that it considered to
> be equivalent to the DOM tree it built the first time around.

Hi Harlan,

by "Source Code" and "Generated Source Code" I refer to the terms used
by "Web Developper" bar in FF. Just to clarify a little bit:
Source code: The code used to display the page
Generated source code: The code generated by the application, which is
what the browser receives as input

So the browser is in fact *removing* the closing tags in a given
filtering process.

Also, to rephrase the second part of initial post, the browser doesn't
process the code the same way when my application sends it the code
(generated dynamically) compare to when I open the same code in a
static html file.

Thanks

Posted by Harlan Messinger on January 6, 2009, 4:00 pm
Please log in for more thread options
twiggy182 wrote:
> wrote:
>> twiggy182 wrote:
>>> Hi,
>>> for some reasons, with the "Web Developper bar" in Firefox, I
>>> discovered that there are differences between the "Source code" and
>>> the "Generated source code" in my application.
>>> The main difference is that all my "</option>" tags are missing in the
>>> "Source code". Because of that, the "<optgroup>" tag isn't recognized
>>> at all in IE ( "</option>" tags are also missing in IE when I view the
>>> source code ).
>>> Source code:
>>> <select>
>>> <optgroup label="My group">
>>> <option value="1">A
>>> <option value="2">B
>>> <option value="3">C
>>> <option value="4">D
>>> </optgroup>
>>> </select>
>>> Generated source code:
>>> <select>
>>> <optgroup label="My group">
>>> <option value="1">A</option>
>>> <option value="2">B</option>
>>> <option value="3">C</option>
>>> <option value="4">D</option>
>>> </optgroup>
>>> </select>
>>> So can someone tell me why both FF and IE remove these closing tab?
>> I don't understand. You are showing that the browser is *adding* the
>> closing tags. The "source code" is the code received by the browser. The
>> "generated source code" is what the browser spits out when it recreates
>> a well-formed HTML document from its in-memory DOM tree (that is, its
>> internal representation of the document).
>>
>>> Another strange thing I noticed: I copied the "Generated source code"
>>> and put it in a new file, and if I open the file in FF or IE,
>>> everything is working well. So I don't understand when this kind of
>>> filtering is applied. Anyone know?
>> What do you mean by "filtering"? Naturally the page looks the same.
>> You're feeding the browser exactly the same code that it considered to
>> be equivalent to the DOM tree it built the first time around.
>
> Hi Harlan,
>
> by "Source Code" and "Generated Source Code" I refer to the terms used
> by "Web Developper" bar in FF. Just to clarify a little bit:
> Source code: The code used to display the page
> Generated source code: The code generated by the application, which is
> what the browser receives as input

Nope. "Source code" is what is received from the server, "generated
source code" is what Firefox spits back out after processing. If the
"generated source code" was what the browser received, what would be
"generated" about it?

Example: create a web page containing:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

                <title>Generated source test</title>
                <p>Try this.

Load it in Firefox. "View source" will give you the above. "View
generated source" will give you:

<html><head>

                <title>Generated source test</title>
                </head><body><p>Try this.

</p></body></html>

where Firefox will have created the required html, head, and body
elements in its internal model, and when you ask it to generate source
code, will display the tags for them, as well as the closing </p> tag.

> So the browser is in fact *removing* the closing tags in a given
> filtering process.

Nope.

Posted by Jukka K. Korpela on January 6, 2009, 4:06 pm
Please log in for more thread options
Harlan Messinger wrote:

[a lengthy quotation, always a useful warning signal, and then...]

> Example: create a web page containing:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
>
> <title>Generated source test</title>
> <p>Try this.
>
> Load it in Firefox. "View source" will give you the above.

Indeed. No surprise.

> "View
> generated source" will give you:
>
> <html><head>
>
> <title>Generated source test</title>
> </head><body><p>Try this.
>
> </p></body></html>
>
> where Firefox will have created the required html, head, and body
> elements in its internal model,

That's mildly surprising, since what I intuitively expected "generated
source" to contain is markup generated by execution of client-side
scripting. And I think this is the most relevant and most useful feature of
this function.

What's wrong in your statement is the word "required". The end tags are
definitively optional by HTML 4.01 rules. You may have meant that they are
"required" by the "internal model" of Firefox, but you did not say that at
all and I don't think it's even true. There is no reason why explicit end
tags would be "required" for an internal model, which is really a tree
structure and has no tags whatsoever.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Similar ThreadsPosted
What's all that stuff in the source code? August 25, 2004, 9:04 pm
better/easy way to displaying c source code in html July 18, 2006, 5:44 am
Code added to my XHTML source files giving problems November 18, 2005, 6:56 pm
Style tags -- Eeek how obese these tags make HTML! November 8, 2006, 3:33 am
Meta Tags, Link Tags, other September 27, 2005, 3:29 pm
Cant view source September 10, 2004, 12:06 pm
Simple Open Source CMS January 23, 2006, 9:00 am
looking for open source forums..... September 8, 2006, 5:48 pm
Web Standards Meets Open Source? September 29, 2004, 11:57 pm
Can an HTML source file be specified in unicode ? March 13, 2005, 12:29 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap