Writing and validating a frameset XHTML document
This tutorial focuses on writing and validating a frameset XHTML document in:
- Windows
- Linux
Windows
Consideration
Consider first, if the XHTML document you are creating should be a frameset XHTML document, and not one of the other XHTML document types. A frameset XHTML document specifies an XHTML document that uses frames to display one or more pages at the same time in the browser window. If you are writing an XHTML document with this purpose in mind, then it should indeed be a frameset XHTML document. Otherwise, you may want to use one of the other XHTML document types. To learn more about the different XHTML document types, read our XHTML document type definition lesson.
NOTE: Since the XHTML document in this tutorial is a frameset, it will require you to write more than one page (three in particular).
The writing process
- Open notepad by going to Start -> Programs -> Accessories -> Notepad OR go to Start -> Run - Type notepad and press Enter.
-
Type in the following code:
<html> <body> Frame 1 </body> </html>
-
Save the file as frame1.html
NOTE: Make sure that you give the file a .html extension and that you save it as type 'All Files', otherwise you will get plain text.
- Open another instance of notepad by going to Start -> Programs -> Accessories -> Notepad OR go to Start -> Run - Type notepad and press Enter.
-
Type in the following code:
<html> <body> Frame 2 </body> </html>
-
Save the file as frame2.html
NOTE: Make sure that you give the file a .html extension and that you save it as type 'All Files', otherwise you will get plain text.
- Open a third instance of notepad by going to Start -> Programs -> Accessories -> Notepad OR go to Start -> Run - Type notepad and press Enter.
-
Type in the following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/ xhtml1/DTD/xhtml1-frameset.dtd"> <html> <head> <title>Frameset</title> </head> <frameset rows="50%, 50%"> <noframes> <body>Your browser does not support frames!</body> </noframes> <frame src="frame1.html" name="frame1" /> <frame src="frame2.html" name="frame2" /> </frameset> </html>
-
Save the file as frameset.html
NOTE: Make sure that you give the file a .html extension and that you save it as type 'All Files', otherwise you will get plain text.
NOTE: Make sure you save all three files in the same directory!
-
Open your web browser.
-
Type into the web browsers location bar the absolute location of the directory where you saved the file frameset.html along with the file name. For example, if you saved the file in C:\windows, type C:\windows\frameset.html into the web browsers location bar.
-
You should now see an XHTML frameset document in your web browser which looks like this:
The validation process
Now that you have written a frameset XHTML document, it's time to validate it.
-
Go to the W3C Markup Validator, located at http://validator.w3.org.
-
The W3C Markup Validator gives you the option of validating a document by URL, by File Upload, or by Direct Input. In this tutorial, you will be validating the document by File Upload. Find the label that says "Local File:" and click the button that says "Browse...." which is directly parallel to it.
-
Locate the frameset.html file on your hard drive, and when you are ready to validate the document, click the button that says "Check"
-
If the document did not validate, you should get a message saying "This page is not Valid XHTML 1.0 Frameset!"
Possible reasons for the document not validating:
- Missing closing tags
- Tags not closed in the right order
- Attribute values not quoted properly
- A missing <!DOCTYPE> declaration
Read the description of the error(s) that the Markup Validator provides. It is usually very descriptive.
-
If the document did validate, you should get a message saying "This Page Is Valid XHTML 1.0 Frameset!"
You now have a valid XHTML frameset document!! This means "that you have taken the care to create an interoperable Web page" as is stated by the W3C Markup Validator.
Linux
Consideration
Consider first, if the XHTML document you are creating should be a frameset XHTML document, and not one of the other XHTML document types. A frameset XHTML document specifies an XHTML document that uses frames to display one or more pages at the same time in the browser window. If you are writing an XHTML document with this purpose in mind, then it should indeed be a frameset XHTML document. Otherwise, you may want to use one of the other XHTML document types. To learn more about the different XHTML document types, read our XHTML document type definition lesson.
NOTE: Since this XHTML document in this tutorial is a frameset, it will require you to write more than one page (three in particular).
The writing process
-
Open nano and type in the following code:
<html> <body> Frame 1 </body> </html>
-
Save the file as frame1.html
-
Open another instance of nano and type in the following code:
<html> <body> Frame 2 </body> </html>
-
Save the file as frame2.html
-
Open a third instance of nano and type in the following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/ xhtml1/DTD/xhtml1-frameset.dtd"> <html> <head> <title>Frameset</title> </head> <frameset rows="50%, 50%"> <noframes> <body>Your browser does not support frames!</body> </noframes> <frame src="frame1.html" name="frame1" /> <frame src="frame2.html" name="frame2" /> </frameset> </html>
-
Save the file as frameset.html
NOTE: Make sure you save all three files in the same directory!
-
Open your web browser.
-
Type into the web browsers location bar the absolute location of the directory where you saved the file frameset.html along with the file name. For example, if you saved the file in /home/user1/desktop, type /home/user1/desktop/frameset.html into the web browsers location bar.
-
You should now see an XHTML frameset document in your web browser with two frames. The first frame should read "Frame 1", and the second frame should read "Frame 2"
Screenshot for Linux coming soon..
The validation process
Now that you have written a frameset XHTML document, it's time to validate it.
-
Go to the W3C Markup Validator, located at http://validator.w3.org.
-
The W3C Markup Validator gives you the option of validating a document by URL, by File Upload, or by Direct Input. In this tutorial, you will be validating the document by File Upload. Find the label that says "Local File:" and click the button that says "Browse...." which is directly parallel to it.
-
Locate the frameset.html file on your hard drive, and when you are ready to validate the document, click the button that says "Check"
-
If the document did not validate, you should get a message saying "This page is not Valid XHTML 1.0 Frameset!"
Possible reasons for the document not validating:
- Missing closing tags
- Tags not closed in the right order
- Attribute values not quoted properly
- A missing <!DOCTYPE> declaration
Read the description of the error(s) that the Markup Validator provides. It is usually very descriptive.
-
If the document did validate, you should get a message saying "This Page Is Valid XHTML 1.0 Frameset!"
You now have a valid XHTML frameset document!! This means "that you have taken the care to create an interoperable Web page" as is stated by the W3C Markup Validator.
Mac
Coming soon..




