Skip to page content or skip to Accesskey List.
Search evolt.org
evolt.org login: or register

Work

Main Page Content

Getting XHTML from HomeSite 4.5

Rated 3.92 (Ratings: 2) (Add your rating)

Log in to add a comment
(5 comments so far)

Want more?

 
Picture of bmason

Bill Mason

Member info | Full bio

User since: October 10, 2000

Last login: April 15, 2007

Articles written: 5

HomeSite, a robust text-based HTML editor for the Wintel world, can be prodded to produce XHTML with a little help. Here's a guide to doing it in the current 4.5 version:

First, go to the Options menu, choose Settings, and configure what you can in the program that will start you down the XHTML path:

  • Under "HTML", check off: Lowercase all inserted tags, Include closing </P> when inserting paragraph tag, and set the "Center" toolbutton to use <div align="center"></div>.
  • Under Editor/Tag Completion: turn this feature on and make sure all the proper HTML tags are in this list (the default that comes with the program does not include all tags).

Before we get to the fun part (editing the program's internal files), let's note that HomeSite 4.5 does include the HTML Tidy utility integrated into it, which can produce XHTML from HTML pretty readily. So if you don't want to mess further with the HomeSite program, HTML Tidy is a good way to go.

Now, to the good stuff: editing HomeSite's tag wizards to produce XHTML. Don't forget to back up these files before you edit them, because if you break them you'll probably have to reinstall the program to fix them.

The VTM files that make up the tag wizards are located in the /extensions/tagdefs/html directory. For each tag that needs to end with " />" (for example, <br />), open it's corresponding VTM file in HomeSite. Look for a line (usually towards the end of the file) that reads <WIZIF 1>></WIZIF> and change it to read <WIZIF 1> /></WIZIF>.

This works for all tags needing the closing slash except for img, which doesn't have a VTM file. You'll have to either take care of img tags manually, or use an alternate VTM file/wizard for your img tags. I use one by Marjolein Katsma, who originally wrote much of the VTML wizards for HomeSite. You can get a copy of it (called TagEditor_Toolbar_HS45.zip) from her web site if you're interested.

Next, we need to edit VTM files for tags such as td, where attributes like nowrap have to be rendered as nowrap="nowrap". Open the VTM file for the tag, and look for a line such as this one in the td file:

<WIZIF checkNOWRAP EQ 'true'>$$SpacingGap$${DefaultCase('NOWRAP')}<WIZSET SpacingGap = VertSpacingGap></WIZIF>

This line is basically outputting nowrap into the tag if the NOWRAP checkbox was checked off. So we just change the output:

<WIZIF checkNOWRAP EQ 'true'>$$SpacingGap$${DefaultCase('NOWRAP=nowrap')}<WIZSET SpacingGap = VertSpacingGap></WIZIF>

At this point, you have all the tag wizards (img aside) producing XHTML. Now, we edit the built-in validator so that it knows all this XHTML is valid:

  • Follow the program menus to Options > Settings > Validation > Validator Settings > Tags > HTML
  • For any tag that needs a closing " />", go to it's Attributes folder. Add an attribute "/" to it, and make the attribute's value equal "no value".
  • For tags with attributes that can no longer be minimized (e.g. td nowrap="nowrap"):
    1. Go to the Values tab and add the value to the list (e.g. nowrap).
    2. Go back to the Tags tab, go to the tag in question (e.g. td), and add the attribute (e.g. nowrap) to the list. Assign the value (e.g. nowrap) to the attribute.

With that, you should have HomeSite producing XHTML, and its built-in validator will recognize it as valid!

Front-end web development (mostly) and an interest/focus in web accessibility. I also recently co-authored my first book, The Web Professional's Handbook, published by the late great glasshaus.

I've been out of work since October 2001. Be kind and glance over my portfolio....

Submitted by bmason on October 19, 2000 - 12:39.

I noticed after the fact an important typo in this section: $$SpacingGap$${DefaultCase('NOWRAP=nowrap')} Should properly read: $$SpacingGap$${DefaultCase('NOWRAP="nowrap"')} Also, after editing VTM files, you should shut down and restart HomeSite to have the change take effect.

login or register to post comments

Submitted by teresa on October 21, 2000 - 13:37.

I have completed the steps outlined in the above article, but I still find any tags I insert using shortcut keys do not appear as modified. However, when I insert a tag using the tag chooser, the correct form appears. I was wondering if anyone else had experienced this problem, and whether there was a fix for it.

login or register to post comments

shortcut key problem

Submitted by gyrus@mail.com on January 24, 2001 - 07:24.

Teresa's bang on there - what's the use if you have to insert
tags and such like with a tag editor to get the XHTML ending? It's quicker to put it in by hand (if you remember). A fix so the changes in VTM files apply to shortcut-invoked tags would be great. Also, anyone know of a resource that lists all tags that have potential 'value-free' attributes, like with 'selected', which will need 'selected="selected"' or whatever inserted?

login or register to post comments

A list of HTML tags not included HomeSite.

Submitted by khusveg on February 19, 2001 - 05:05.

HomeSite 4.5.2 Options menu, choose Settings, under Editor/Tag Completion. A list of HTML tags not included with the default program, that you might consider adding. ... = abbreviation. ... = delineates an inserted section. ... = used to label a fieldset grouping. ... = no line breaks allowed in the enclosed text, (non-standard but worth a mention). ... = used to create a list of options within a element. ... = defines the choices in a list. ... or = supply a parameter to a or . ... = used to enclose text in an inline quote. ... = a descriptive element rendered as mono-spaced font. ... = formats a teletype-style font.

login or register to post comments

shortcuts issue homesite 4.5 and xhtml

Submitted by pepijn on January 11, 2006 - 16:02.

you can go to the 'snippets' tab >> add folder >> add snippet for example: <br /> or <link type="text/css" href="" rel="stylesheet" /> then click on toolbar >> customize... >> snippet shortcuts >> select a snippet and define a shortcut for example ctrl + shift + b for a <br /> . override the one defined by homesite and there you have xhtml shortcuts. :)

login or register to post comments

The access keys for this page are: ALT (Control on a Mac) plus:

evolt.orgEvolt.org is an all-volunteer resource for web developers made up of a discussion list, a browser archive, and member-submitted articles. This article is the property of its author, please do not redistribute or use elsewhere without checking with the author.