Home->Sock->Examples->The Web Sock

The Web Sock

This example is intended to give you a feel for how Sock is used.

The web page you are looking at now is derived from XML input that looks like this:


   <w:page name="sock" link="Sock">
      <w:title>Sock: A Software Construction Kit</w:title>
      <w:body>
         ...
      </w:body>
      <w:page ... other pages
      </w:page>
      <w:page name="sock-web" link="The Web Sock">
         <w:title>Web Sock: Developing Web Sites</w:title>
         <w:body>
	    <h2>The Web Sock</h2>
            <p>This example ...

The body of each page is embedded in w:page tags, which are themselves nested to reflect the structure of the web site. It is this structure which is used to generate the menu tree you see on the left.

There are advantages to writing this way rather than use a wysiwyg editor: you are encouraged to concentrate on content rather than presentation, so you get for free the alternate text only format for the site (or any other format you care to invent).

There are disadvantages too, one being how do you find your way from the rendition of a page in the web browser to the original source code?

Sock has an answer to that one. In development mode we set a flag which adds a small 'edit' icon to the rendered HTML:

If you drag this icon and drop it on the 'Edit' button of the Sock application window, your editor will open the source file at the line where the current web page starts.

A future version of Sock will provide a similar function for use where the output files are not HTML. So you will be able to look at generated Java or C code and see immediately where it came from.


@The Web Sock  

Feedback

Copyright © 2002-2008 Melvaig Technologies Limited