Solved

iframe in xhtml1.1 how-to?

Posted on 2003-11-05
8
760 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 17

Expert Comment

by:dorward
Comment Utility
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
Comment Utility
>  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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

743 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

15 Experts available now in Live!

Get 1:1 Help Now