Solved

iframe in xhtml1.1 how-to?

Posted on 2003-11-05
8
763 Views
Last Modified: 2007-12-19
Greetings,

Xhtml 1.1 doesn't seem to have the iframe module in its standard dtd. It should be possible to add the iframe module yourself.

However, I'm having a hard time finding easy-to-read documentation or a simple dummy tutorial on how-to expand the xhtml1.1 dtd with the iframe module. I'm not a newbie on html, but I don't quite grasp xhtml modularisation.

Therefore, 2 questions:
1) Do I need to expand the xhtml1.1 dtd with the iframe module to use an iframe in xhtml 1.1 or not?
2) If so, how do I do that? If not, is there another way?

Imagine!
0
Comment
Question by:OmegaJunior
  • 4
  • 3
8 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 125 total points
ID: 9686923
Why are you using XHTML 1.1 in the first place? Or iframes for that matter?

http://www.w3.org/TR/1999/WD-xhtml11-19990910/xhtml11_modules.html#a_module_Iframe has the iframe module.

http://www.juicystudio.com:80/tutorial/xhtml/module.asp should get you going with using it.

Frankly, if you have a pressing need for XHTML, use 1.0. Browser support is such that 1.1 isn't generally wise (MSIE rejects it entirely as it can't conform to the spec and be sent with a text/html content type). If you have a pressing need for iframes, use 1.0 Transitional. Most people shouldn't have a pressing need for either.
0
 
LVL 3

Author Comment

by:OmegaJunior
ID: 9687163
Thank you dorward, this looks interesting. I'm going to try it.

Why do I want to use xhtml 1.1? Just because. I'm a geek. ;) I can do this in xhtml1.0 transitional. And as far as I've seen, Internet Explorer 6 has no trouble rendering xhtml 1.1. (My host, otoh, has the nasty habit of preprocessing all html and replaces the <body> with <BODY>, very bad.)

Why do I want to use an iframe? I have about 160 articles, that are going to be marked up in xml. (They're in html right now, published on my own site, living there very happily.) By using a frame, I can load any article into a "static" backdrop that holds the navigational menus. Using css I can attach styling to the articles. So I could use a normal frame, if my backdrop had allowed that. However, I'm working on a specific backdrop that makes the use of a normal frame quite hard, if not impossible. An iframe is much better suited for this particular job.

Instead of an iframe I could of course use javascript to load the article information into a div in the backdrop. But when someone had turned off javascript support in their browser, no information would be seen. Very bad for an information web site. By using an iframe I have a) far better chances for the information to be seen and b) no need to write browser-specific code for handling xml-import.
0
 
LVL 17

Expert Comment

by:dorward
ID: 9687245
XHTML 1.0 is allowed to be served as text/html
XHTML 1.1 is not.

When you serve Internet Explorer some application/xhtml+xml it prompts the user to download it.

Try avoiding frames altogether and use CSS for the layout, in layout terms it can recreate an iframe easily (height: 30em; width: 30em; border: solid black 1px; overflow: auto;), then you can use a preprocessor (http://www.cs.tut.fi/~jkorpela/html/cpre.html - and there are other, less geeky ones) to include common content in each page. Then you get the added benefit of being friendly to Googlebot, Lynx users, Palmtop users and people who want to bookmark a specific article.
0
 
LVL 3

Author Comment

by:OmegaJunior
ID: 9687392
The Internet Explorer stupidity is a matter of time. I'm not going to stop my progress because of some browser. I've already revised my backdrop a couple of times because IE is too stupid to understand position:fixed. So let's not dive into IE. :)

I can't use preprocessing to include these files, as my files are hosted on a third party host. This host does allow for cgi but afaik not things like php or asp, which both would've been nice in this particular case. So if I can do it without server-side processing or client-side processing, I will. Less code means less mistakes. Of course finding another host is an option, but I like their service and have been hosted by them for a decade.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:dorward
ID: 9687476
Preprocessing can happen in a couple of places:

Author->Upload->Preprocess->Download
or
Author->Preprocess->Upload->Download

I was suggesting the second option.  You combine the files on your workstation before uploading.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9687493
>  When you serve Internet Explorer some application/xhtml+xml it prompts the user to download it.

That depends on the version. IE 6 will display a document tree unless you include a <?xml-stylesheet type="text/css" href="display.css"?> PI with it.

However, there's another issue -- Opera 7 does not support the <script> element for docs served as XML. You can stick scripts on event handler attributes and they'll run, but that's about it. And I'm trying to get rid of event handler attributes in all my docs and use only handlers defined in script.

Personally, while I love the idea of using XHTML, I've gone back to HTML 4.01 Trans or Strict for the time being, as there are too many problems with MSIE's quirks mode and the Opera scripting issue.
0
 
LVL 3

Author Comment

by:OmegaJunior
ID: 9687575
Ah, I wondered why Opera dropped the scripting. Internet Explorer isn't too happy with my scripts either. Only Mozilla varieties will run the scripts flawlessly.

As for the preprocessing: The idea of using a frame is that only the contents of that frame is sent and loaded. The entire backdrop remains, already loaded, in the browser. Otherwise combining the backdrop with each article wouldn't have been a problem.
0
 
LVL 3

Author Comment

by:OmegaJunior
ID: 9693549
Dorward, thank you for the link to Juicy. Their information and examples work perfectly. My testcase pages validated successfully against the Juicy iframe dtd.

As soon as the world's most used browser gets its act straight, I'll implement it in my site. As for now, I'll keep using xhtml1.0 transitional.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now