473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Solving script and other problems for serving true xhtml 1.1

I am now writing many new pages in xhtml 1.1. They are served as true
xhtml by setting the mime type of the server to application/xhtml+xml
for the .xhtml extension. Since IE6 and some earlier browsers can not
handle this mime type, a simple php include is at the very top of such
pages. If the mentioned mime type support for the viewing browser is
detected, everything above the head tag of the page is written in xhtml
1.1 code. If the browser can only support text/html, then everything
above the head tag is written in html 4.01 strict. Also a regular
expressions converts self-closed tags such as <br /> to <br> as
required for html 4.01 strict. Several methods of using such a php
script have been reported. I selected methods that work best for my
purposes.

Code for media is very difficult to get to work on a variety of
browsers and also validate. See
http://www.cwdjr.info/media/playersRoot.php . This page has many links
that will explain how one writes the code. The WMP(Script) link will be
of most interest to this group. In an older html version of this page,
many document.writes were used in for loops to write a very large
number of divisions. This will not work when written in xhtml 1.1 and
served as mime type application/xhtml+xml. When you serve true xhtml
1.1, browsers that can handle it become very strict and parse the page
in xml. Even the smallest error, such as one unclosed tag, gives a xml
error message rather than a view of the page. However this problem is
easily solved by writing a server side php script to replace the client
side javascript that included the forbidden document.write for loops.
The browser now gets all of the divisions that are written by the
server so that the xml parser can check all of them for closed tags,
etc. Tags that are not closed are one of the major no-nos of xml. If
you use a document.write there is no telling what code it might
generate, including unclosed tags an symbols forbidden by xml. Of
course in simple cases you sometimes can use DOM methods to get around
a document.write, but in this case with so many complicated expressions
using document.write, it is much easier to use php on the server. Or
you can use Perl or other languages that you might like better.

Next view the page at http://www.cwdjr.net/geometric/tilelayerRoot.php
.. You may view the text of the php page at:
http://www.cwdjr.net/geometric/tilelayerRoot.txt . This page in the
original html version generated about 2500 divisions using a nest of 3
for loops with a document.write at the bottom of the nest. Of course
this will not work in true xhtml served as such. In this case nearly
all of the code is written in php at the server and downloaded when the
page is called. This is a very extreme example. However, if you have
both a Mozilla family(Mozilla, Firefox, or Netscape) and Opera browsers
in recent versions, view the page on both. You will notice that the
Mozilla family browsers show you nothing until the page is completely
downloaded. However the Opera browser shows each cell as it is
completed. Thus Opera seems to handle a long page much better than the
Mozilla family, since it allows you to see something as the code is
processed. The Mozilla family browsers also have a css bug when the
page is partly filled. The background-color used in the css style sheet
extends only to the bottom of the content of a short page, leaving the
bottom of the page white. If you use only absolute positioning, the
background-color is not displayed at all! This is easily corrected by
enclosing the whole page in a division with a background-color set in
the style for the division. This is shown in the code of some of the
pages I quoted. Opera does not have this background-color bug. From
what I have seen, Opera handles true xhtml 1.1 better than the Mozilla
family browsers. However, if I had used other pages, it is quite
possible I could have found some Opera bugs that do not apply to the
Mozilla family.

Aug 27 '05 #1
1 1880

cw******@yahoo.com wrote:
You may view the text of the php page at:
http://www.cwdjr.net/geometric/tilelayerRoot.txt .


If you use the IE6 browser to view this page, you will have to right
click and select show code to bring up the php code. The IE6 browser
has trouble showing text files of some php and some SMIL code.

Aug 27 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript>...
11
by: Dan Rubin | last post by:
HI everyone, lurking for a long time here, since I can usually solve my own problems, but here is one I'm stumped by. I've got a valid XHTML 1.0 Transitional layout, and all the CSS is valid as...
38
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } ...
29
by: Steve | last post by:
I have worked on a couple of sites which google's bot visits, partially lists and then goes away again. MSN and Yahoo are fine and working. Can anyone please suggest what, if anything, is...
32
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with...
44
by: rhythmace | last post by:
W3C HTML validator passes this: .... <script type="text/javascript" src="foo.js"> <script type="text/javascript"> ....script in here... </script> ....
30
by: abracad_1999 | last post by:
Is it possible to serve valid xhtml with php? xhtml requires the 1st line: <?xml version="1.0" encoding="iso-8859-1"?> But php interprets the opening <? as a php statement. If I try to echo...
15
by: Lennart | last post by:
Hi folks, I have created an animated image gallery in dhtml. It works fine in Internet Explorer. In Firefox, it only works if I ommit the DOCTYPE tag. The page is valid xhtml-strict but with a...
2
by: SMH | last post by:
I am in the process of converting all HTML documents, including many dynamic/interactive documents, to XHTML documents (because I want to incorporate SVG and MathML, among other things). I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.