HighDots Forums  

Problem in auto-generated HTML

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Problem in auto-generated HTML in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jack Crenshaw
 
Posts: n/a

Default Problem in auto-generated HTML - 06-27-2009 , 11:41 AM






I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for text,
math, and graph objects. When I try to display the generated file in
Firefox, the equations overlay the preceding text.

The problem seems to be the use of constructs like this:

<div style="position:absolute;top:96;left:20">
<layer >
<img src="./Test File_images/IMG0003_62826203.PNG" border="0"/>
</layer>
</div>

It's the absolute address that seems to be the problem. I'd appreciate
comments and suggestions for a way to fix the problem. For example, why
not just substitute <p>...</p> blocks for the div sections?

For reasons I don't understand, Firefox and IE8 render the page
differently. IE has too much vertical space before the equation --
Firefox doesn't have enough.

Comments?

Jack

Reply With Quote
  #2  
Old   
C A Upsdell
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 01:24 PM






Jack Crenshaw wrote:
Quote:
I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for text,
math, and graph objects. When I try to display the generated file in
Firefox, the equations overlay the preceding text.

The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
layer
img src="./Test File_images/IMG0003_62826203.PNG" border="0"/
/layer
/div

It's the absolute address that seems to be the problem. I'd appreciate
comments and suggestions for a way to fix the problem. For example, why
not just substitute <p>...</p> blocks for the div sections?

For reasons I don't understand, Firefox and IE8 render the page
differently. IE has too much vertical space before the equation --
Firefox doesn't have enough.

Comments?
One interesting aspect of the code you cite is the use of the <layer>
tag, a tag which is not HTML: it is a Netscape invention, not supported
since Netscape 4. So the code is quite archaic.

A second aspect is that the absolute block should be inside another
block that is positioned, e.g. using position:relative. The code you
cite does not indicate such an outer block exists.

A third aspect is that IE gets a lot of positioning wrong, so that
different behaviour is very possible with different versions of IE: and
if the code emitter was written when Netscape 4 was a major browser,
perhaps the other code (which you do not cite) was designed for archaic
versions of IE, and may not work with more modern, more standards
compliant versions.

Reply With Quote
  #3  
Old   
David E. Ross
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 01:36 PM



On 6/27/2009 10:24 AM, C A Upsdell wrote:
Quote:
Jack Crenshaw wrote:
I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for text,
math, and graph objects. When I try to display the generated file in
Firefox, the equations overlay the preceding text.

The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
layer
img src="./Test File_images/IMG0003_62826203.PNG" border="0"/
/layer
/div

It's the absolute address that seems to be the problem. I'd appreciate
comments and suggestions for a way to fix the problem. For example, why
not just substitute <p>...</p> blocks for the div sections?

For reasons I don't understand, Firefox and IE8 render the page
differently. IE has too much vertical space before the equation --
Firefox doesn't have enough.

Comments?

One interesting aspect of the code you cite is the use of the <layer
tag, a tag which is not HTML: it is a Netscape invention, not supported
since Netscape 4. So the code is quite archaic.

A second aspect is that the absolute block should be inside another
block that is positioned, e.g. using position:relative. The code you
cite does not indicate such an outer block exists.

A third aspect is that IE gets a lot of positioning wrong, so that
different behaviour is very possible with different versions of IE: and
if the code emitter was written when Netscape 4 was a major browser,
perhaps the other code (which you do not cite) was designed for archaic
versions of IE, and may not work with more modern, more standards
compliant versions.


Given Upsdell's comment on <layer>, I suggest you test the page at
<http://validator.w3.org/>. If Mathcad also creates style-sheets, that
should be tested at <http://jigsaw.w3.org/css-validator/>.

If you are getting excessive errors, you should consider a different
HTML generator. Alternatively, continue to use Mathcad, but then
manually correct the errors.

The presence of any HTML errors can cause different browsers to render a
page quite differently. Browsers are often coded to attempt to "guess"
what a Web author really meant when an error is detected, but different
browsers guess differently.

--

David E. Ross
<http://www.rossde.com/>.

Don't ask "Why is there road rage?" Instead, ask
"Why NOT Road Rage?" or "Why Is There No Such
Thing as Fast Enough?"
<http://www.rossde.com/roadrage.html>

Reply With Quote
  #4  
Old   
Ben C
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 04:15 PM



On 2009-06-27, Jack Crenshaw <jcrens (AT) earthlink (DOT) net> wrote:
Quote:
I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for text,
math, and graph objects. When I try to display the generated file in
Firefox, the equations overlay the preceding text.

The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
layer
img src="./Test File_images/IMG0003_62826203.PNG" border="0"/
/layer
/div

It's the absolute address that seems to be the problem. I'd appreciate
comments and suggestions for a way to fix the problem. For example, why
not just substitute <p>...</p> blocks for the div sections?

For reasons I don't understand, Firefox and IE8 render the page
differently. IE has too much vertical space before the equation --
Firefox doesn't have enough.

Comments?
Post a URL to an example page and maybe we can think of a cunning trick
to fix it by adding a couple of CSS rules.

Reply With Quote
  #5  
Old   
Jack Crenshaw
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 04:19 PM



C A Upsdell wrote:
Quote:
Jack Crenshaw wrote:
I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for
text, math, and graph objects. When I try to display the generated
file in Firefox, the equations overlay the preceding text.

The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
layer
img src="./Test File_images/IMG0003_62826203.PNG" border="0"/
/layer
/div

It's the absolute address that seems to be the problem. I'd appreciate
comments and suggestions for a way to fix the problem. For example,
why not just substitute <p>...</p> blocks for the div sections?

For reasons I don't understand, Firefox and IE8 render the page
differently. IE has too much vertical space before the equation --
Firefox doesn't have enough.

Comments?

One interesting aspect of the code you cite is the use of the <layer
tag, a tag which is not HTML: it is a Netscape invention, not supported
since Netscape 4. So the code is quite archaic.
AHA!! That's the kind of thing I was looking for. Thanks.
Quote:
A second aspect is that the absolute block should be inside another
block that is positioned, e.g. using position:relative. The code you
cite does not indicate such an outer block exists.
Well, it's not. The hierarchy is

html/body/div/span/layer

The absolute addresses are inside the <span> tag, as I showed. And the
addresses really do seem to be absolute, not relative. As I progress
through the file, the top address continues to increase monotonically.
Quote:
A third aspect is that IE gets a lot of positioning wrong, so that
different behaviour is very possible with different versions of IE: and
if the code emitter was written when Netscape 4 was a major browser,
perhaps the other code (which you do not cite) was designed for archaic
versions of IE, and may not work with more modern, more standards
compliant versions.
Ok. I think what you're telling me is, getting this file cleaned up is
going to be pert-near impossible. I was sort of hoping that I could
replace the <div> tags with <p> tags, or something equally painless.
Sounds like it's not going to happen.

Thanks very much for your input.

Jack
Quote:

Reply With Quote
  #6  
Old   
Jack Crenshaw
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 04:44 PM



David E. Ross wrote:
Quote:
On 6/27/2009 10:24 AM, C A Upsdell wrote:
Jack Crenshaw wrote:
I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for text,
math, and graph objects. When I try to display the generated file in
Firefox, the equations overlay the preceding text.

The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
layer
img src="./Test File_images/IMG0003_62826203.PNG" border="0"/
/layer
/div

It's the absolute address that seems to be the problem. I'd appreciate
comments and suggestions for a way to fix the problem. For example, why
not just substitute <p>...</p> blocks for the div sections?

For reasons I don't understand, Firefox and IE8 render the page
differently. IE has too much vertical space before the equation --
Firefox doesn't have enough.

Comments?
One interesting aspect of the code you cite is the use of the <layer
tag, a tag which is not HTML: it is a Netscape invention, not supported
since Netscape 4. So the code is quite archaic.

A second aspect is that the absolute block should be inside another
block that is positioned, e.g. using position:relative. The code you
cite does not indicate such an outer block exists.

A third aspect is that IE gets a lot of positioning wrong, so that
different behaviour is very possible with different versions of IE: and
if the code emitter was written when Netscape 4 was a major browser,
perhaps the other code (which you do not cite) was designed for archaic
versions of IE, and may not work with more modern, more standards
compliant versions.



Given Upsdell's comment on <layer>, I suggest you test the page at
http://validator.w3.org/>. If Mathcad also creates style-sheets, that
should be tested at <http://jigsaw.w3.org/css-validator/>.

If you are getting excessive errors, you should consider a different
HTML generator.
Can't very well do that. It's built into Mathcad.

Quote:
Alternatively, continue to use Mathcad, but then
manually correct the errors.
Thanks. For the record, I tried the simple expedient of replacing a few
of the <div> tags with <p> tags, and deleting the <layer> tags
completely. It "sorta" worked, in the sense that the elements now no
longer overlap each other. But the original file has multiple items on
the same line, so I've got to figure out how to do that.

Many thanks for the advice.

Jack
Quote:
The presence of any HTML errors can cause different browsers to render a
page quite differently. Browsers are often coded to attempt to "guess"
what a Web author really meant when an error is detected, but different
browsers guess differently.

Reply With Quote
  #7  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 04:48 PM



Jack Crenshaw wrote:
Quote:
I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for text,
math, and graph objects. When I try to display the generated file in
Firefox, the equations overlay the preceding text.
Also not mentioned is that "style" properties created by this Mathcad
are invalid as well

Quote:
The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
^^ ^^
Position 96 what? Bananas? Left what?

If this snippet is any indication of the overall quality of the *whole*
page you may be lucky that it displays at all. Consistency would be just
luck.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Reply With Quote
  #8  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 05:07 PM



Jonathan N. Little wrote:

Quote:
The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
^^ ^^
Position 96 what? Bananas? Left what?
The tricky part is that such CSS code "works" on some browsers in some
circumstances. That is, it has the effect that the author meant, even though
such behavior violates CSS specifications.

More exactly, some browsers (e.g., IE 8 in "quirks" mode) interpret the
numbers as numbers of pixels. More correct browsers (e.g., IE 7 in
"standards" mode) ignore the declarations top:96 and left:20 as required by
the specs.

Quote:
If this snippet is any indication of the overall quality of the
*whole* page you may be lucky that it displays at all.
Indeed.

(I'd like to trim followups, as crossposting to three groups is seldom a
good idea. However, as usual in crossposted threads, _none_ of the groups is
the right one...)

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

Reply With Quote
  #9  
Old   
Jack Crenshaw
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 11:07 PM



Jonathan N. Little wrote:
Quote:
Jack Crenshaw wrote:
I've encountered a problem with HTML files generated by Mathcad using
the "save as HTML" option. Among other things, Mathcad allows for
text, math, and graph objects. When I try to display the generated
file in Firefox, the equations overlay the preceding text.

Also not mentioned is that "style" properties created by this Mathcad
are invalid as well


The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
^^ ^^
Position 96 what? Bananas? Left what?
Pixels. Which right off the bat seems like a Bad Idea, right?
Quote:
If this snippet is any indication of the overall quality of the *whole*
page you may be lucky that it displays at all. Consistency would be just
luck.
Yeah, this situation seems to be unsalvageable.

Thanks

Jack
>

Reply With Quote
  #10  
Old   
Jack Crenshaw
 
Posts: n/a

Default Re: Problem in auto-generated HTML - 06-27-2009 , 11:09 PM



Jukka K. Korpela wrote:
Quote:
Jonathan N. Little wrote:

The problem seems to be the use of constructs like this:

div style="position:absolute;top:96;left:20"
^^ ^^
Position 96 what? Bananas? Left what?

The tricky part is that such CSS code "works" on some browsers in some
circumstances. That is, it has the effect that the author meant, even
though such behavior violates CSS specifications.

More exactly, some browsers (e.g., IE 8 in "quirks" mode) interpret the
numbers as numbers of pixels. More correct browsers (e.g., IE 7 in
"standards" mode) ignore the declarations top:96 and left:20 as required
by the specs.

If this snippet is any indication of the overall quality of the
*whole* page you may be lucky that it displays at all.

Indeed.

(I'd like to trim followups, as crossposting to three groups is seldom a
good idea. However, as usual in crossposted threads, _none_ of the
groups is the right one...)
Sigh. What would we do without etiquette police?

Jack
>

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.