Jump to content
xisto Community
vizskywalker

Mixing XHTML 1.1 And iFrame Or how to get around using iframes for a nifty AJAX trick

Recommended Posts

Okay, first of all, I let me explain what I want to know.XHTML 1.1 does not include the IFrame Module, which means putting an iframe into an XHTML 1.1 page will cause errors in validation. Now, I know from the Modularization of XHTML Specification that it is possible to create a DTD that contains all of the modules of XHTML 1.1 as well as the IFrame module. However, after reading through said specification, I am unsure of exactly how to go about a) writing a DTD like that and :) using a DTD like that. So I need to know how to make and use DTDs that include various modules from the Modularization of XHTML Specification.Now, the reason I want to use iframes is because of a little AJAX trick. Firefox and various other browsers register changes in iframes with the history, so you can navigate through the changes in the iframes with the back and forward buttons. This means that using some javascript and a series of iframes, it is possible to register different pieces of information retrieved with AJAX with the browser's history. Google Maps uses this trick.It would be great if I could use objects instead of iframes to do the same trick, but there are two problems.1) objects are completely broken in IE2) Changing the data of an object doesn't cause it to automatically reload in Firefox.I can deal with my site being broken in IE, if need be. But in order to use objects, I need to know how to cause Firefox to reevaluate the data. So that would also be a good answer to the question posed in this post. I have seen one method of reloading objects that clones objects with new data and replaces, but that doesn't work. In order to register with the history, I believe it must be the same object. But since I can't get Firefox to reload, I don't even know if that will register with the history.So once again, what I'd really like to know is, how can I use Modularization of XHTML to mix the IFrame Module and the other modules in XHTML 1.1?~Viz

Share this post


Link to post
Share on other sites

Creating your own DTD is not hard at all, it'll take a while to understand it but within a few days you should grasp how to go about this, here's a brief tutorial from w3c to help you http://www.w3.org/MarkUp/Guide/xhtml-m12n-tutorial/

 

You may want to look into XHTML 1.0 Transitional for the Iframe information you'll require to create a module to add into it.

 

There is a working draft in W3C to create an alternative iframe means for XHTML called XFRAME but it's not ready yet.

 

Cheers,

 

MC

Share this post


Link to post
Share on other sites

Well couldn't you set up a series of php scripts to pull off a iframe? Or set something up with ajax that creates an iframe that validators cannot "Scan"?But with what mastercomputers said, best to trim down to 1.0 and wait for this Xframe to come out.

Share this post


Link to post
Share on other sites

Or set something up with ajax that creates an iframe that validators cannot "Scan"?

The whole purpose in using an iframe is to add functionality to an AJAX application. Using ajax to create something like an iframe prevents any added functionality by limiting all the functionality to things that can be accomplished with AJAX. So, although it could work in creating iframes, it would not be feasible for the needed functionality.
And I think, looking at the XHTML 1.1 DTD, that it might be pretty easy to add to it the IFrame Module (which is already defined by the way). The only problem I can forsee is if the XHTML DOM does not establish rules for iframes, in which case I need to figure out what to add to define rules for where iframes can appear in the DOM.

~Viz

Share this post


Link to post
Share on other sites

I've been working on a DTD from scratch now, using XHTML 1.1 as my basis, since I eventually want to include everything that is present in XHTML 1.1.

My DTD is here and my Document Model Module is here. My test page is here.

When I attempt to validate, for some reason, the validator keeps failing to identify this as a form of XML. I am not sure why. I was wondering if it is because of something I did, in which case, what? Or if it is because of the validator. Here is a link to the validator page. Any insight here would be helpful.

~Viz

Edit: I figured out part of the problem is that the page should have been served as application/xhtml+xml but was being served as text/html. I have fixed this problem, but it still refuses to validate. After looking into some bug reports on the validator, namely Bug 22 it seems to be a problem with the validator. However, if someone could check anyway and make sure that the problem isn't something stupid I left out, I would appreciate it.

Also, for some reason it seems to be picking up the XMLSchema-instance namespace as well as the XHTML namespace. If anyone can figure out why this is I would appreciate it.

Share this post


Link to post
Share on other sites

I've understood that the W3C validator doesn't work with custom DTDs. But, as your document is XML you can use any XML validator to check if the doc conforms to your DTD. There's plenty of them validators available just search and grab the one you like.

Share this post


Link to post
Share on other sites

Okay, I found this validator, which seems to accurately describe the problem. (Oh, by the way, I have decided to instead of working from scratch, simply modify the XHTML 1.1 DTD) I keep running into problems in which I can't figure out how the original XHTML 1.1 specification works. Here is the current validation page. The problem lies currently in the IFRAME module, which I did not write myself. I am not really sure what the problem is, but it seems to possibly be having trouble in that it is exclusively using the qname module I wrote and not using mine in addition to the default (I have no idea how the DTD even knows to default to the proper qname module).

The files can all be found here

~Viz

Share this post


Link to post
Share on other sites

To revive this old post, which I still haven't figured out yet.
The other day I was looking through the modularization and XHTML 1.1 specifications, and I notcied how they added MathML. It seemed to be a very simple DTD which simply included the MathML DTD and XHTML 1.1 DTD. So I tried mimicking it, but substituting the IFrame module for the MathML module. The DTD validated fine, but any pages using it complained that <iframe> was undefined. I noticed, when validating the DTD, that it did not check my custom content-model, so I fiddled with the code until it did. But now when I validate the DTD, it doesn't validate, and the problem seems to be inside the IFrame DTD, which I doubt because the W3C wrote that. Any help would be appreciated.

The Files:
My custom DTD: http://forums.xisto.com/no_longer_exists/
My custom content-model: http://forums.xisto.com/no_longer_exists/
My test page: http://forums.xisto.com/no_longer_exists/
The DTD validator: http://forums.xisto.com/no_longer_exists/:
//http://forums.xisto.com/no_longer_exists/
The W3C validator for the test page: http://validator.w3.org/check?uri=http%3A%m%2Ftest2.xhtml

~Viz

Share this post


Link to post
Share on other sites

Vizskywalker, your pages are no more available :(

Mixing XHTML 1.1 And iFrame

 

Your work seams to be very interesting, I'm trying to do some iframe work with dtd personalized and xhtml1.1

 

Could you please let us know how you managed it ?

 

It would be great for me cause I'm not able to find other examples...

 

-question by Kyarha

Share this post


Link to post
Share on other sites
Embedding Google CalendarMixing XHTML 1.1 And iFrame

hey, I'm having similar issues, only I cannot change my doctype as it is inherited from people higher up at my university.  I want to embed a google calendar into my office's webpage, only it uses iframe and my doctype is xhtml 1.1 strict.  Link is here:

http://forums.xisto.com/no_longer_exists/

I've got an object tag andhave tried the "text/html" type and the "application/xhtml+xml" type, and both work in Firefox and Chrome, but neither work in IE.  Any ideas? I don't want to go back to iframes, but if I have to I will, validation be damned.

-reply by Surfrock66

Share this post


Link to post
Share on other sites

Using iframe with xhtml 1.1 strictMixing XHTML 1.1 And iFrame

This will conform to w3c standards.

 

<p><iframe src="yourpage.Html" width="500" height="500" scrolling="0"></iframe></p>
I know this is an old post but maybe it will help someone.

-reply by Mike

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.