Web DevCenter
oreilly.comSafari Books Online.Conferences.
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA

Sponsored Developer Resources

Web Columns
Adobe GoLive
Essential JavaScript

Web Topics
All Articles
Scripting Languages

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed

Learning Lab

Get Lean with GoLive 6
Pages: 1, 2

Creating Valid Markup

Looking at the source again, you'll see that GoLive is using a bunch of proprietary tags. For example, it's inserting a <csscriptdict import> tag where the script library is imported. Where the rollovers are, it's using a <csob> tag. These tags aren't valid HTML; GoLive uses them internally to identify objects. When you switch to layout view and see a rollover object, it's the <csob> tag that allows GoLive to identify it, show you the right icon, and present you with all of the options for that object in the inspector. Browsers will ignore these tags when parsing the markup, but their inclusion means the pages will fail any validation tests. This can easily be rectified.

In site Settings > Upload/Synch Times, there's an option to strip the HTML code of Adobe GoLive elements. If you have this option turned on, for every page you upload to your server, GoLive will remove all the proprietary tags. This means your page has a much better chance of passing any validation tests.

You can also choose to strip GoLive elements any time you use GoLive's incremental upload feature. When the Upload options box appears, click the button that says Strip Options and you can choose to remove the GoLive elements then.

Stripping out the GoLive elements is just one aspect of producing valid markup. GoLive has several other features that can help you achieve this.

What Is Valid Markup?

Valid markup is markup that passes the recommendations laid down by the W3C, the body that defines (X)HTML. The first important part of writing valid markup is to declare a DOCTYPE. DOCTYPE tells a browser what markup to expect. Including a DOCTYPE in your pages can save valuable processing time because the browser knows exactly what kind of markup to expect, and will display the page accordingly. GoLive helpfully allows to you to set the target DOCTYPE.

Pic 8. Setting the DOCTYPE.
Setting the DOCTYPE.

There are two type of DOCTYPE statement -- long and short. GoLive provides the tools to handle both. To set the target DOCTYPE, select the flyout menu on the top right of your page and select DOCTYPE. By default, GoLive uses the shortened version of the DOCTYPE. For the long version, press Alt (Option) while selecting the flyout. If you'd like to read more about DOCTYPE then read this "Use the Right Doctype" article on the O'Reilly Network.

Pic 9. Example of the short DOCTYPE.
Example of the short DOCTYPE.

Pic 10. Example of the long DOCTYPE. (Click on the screen shot to open a full-size view.)
Click for larger view

GoLive can also configure the object palette to conform to your chosen DOCTYPE. The configured palette will only display objects that are valid for your chosen version of (X)HTML. To configure the object palette, go to the flyout menu at the top right of the object palette, select Configure, and select a DOCTYPE version.

Pic 11. Configuring the object palette for a DOCTYPE. (Click on the screen shot to open a full-size view.)
Click for larger view

Once selected, GoLive will only show valid objects for your chosen DOCTYPE.

Pic 12. The Reduced Object Palatte.
The Reduced Object Palatte.

GoLive has another trick up its sleeve when it comes to producing compliant markup: it can check your markup. Go to Edit > Syntax Check. Then set a DOCTYPE target. In the bottom pane of the palette, elements can be turned on and off. Doing this prior to a Strip Elements upload allows for a page with GoLive elements in it to be validated before uploading.

Pic 13. The Syntax Check window.
The Syntax Check window.

Once you hit OK, GoLive will scan your markup and check it. If there are errors, it will produce a report like the one below.

Pic 14. The error report.
The error report.

Clicking on the error will take you to the error in your markup, as shown in the picture below.

Pic 15. Highlighting the error. (Click on the screen shot to open a full-size view.)
Click for larger view

GoLive now provides you with the tools to produce lean, efficient valid markup. Using them will benefit you and your client. And the next time your friend -- the die-hard hand coder -- tells you that GoLive produces bloated code and invalid markup, smile knowingly and think "Yeah ... Right!"

Derry Thompson is currently co-owner of GloDerWorks with his partner Gloria Hansen. An active participant in the GoLive community and an avid Mac user, he can be found in various airports using his Titanium G4 Powerbook.

Return to the Web Development DevCenter.