© 2004 Microsoft Corporation. All rights reserved.

Figure 1

Standardizing HTML Column Widths


<table cellspacing="0" cellpadding="0" width="90%" border="0">
  <tr>
    <td width="1%">
      <img align="absmiddle" height="64" alt="corner" 
           src="01.gif" width="18">
    </td>
    <td width="1%">
      <img align="absmiddle" height="64" alt="logo" src="02.gif"
       width="152">
    </td>
  <td width="97%" bgcolor="#cccc99" align="middle">
      Table: 90% | Cells 1, 2, &amp; 4:&nbsp;1% | This cell: 97%
  </td>
  <td width="1%">
    <img align="absmiddle" height="64" alt="corner" src="04.gif" 
         width="18">
   </td>
  </tr>
</table>
Figure 2

Multiple Namespaces


<Bookcase xmlns:bookcase="http://schemas.microsoft.com/bookcases">
  <bookcase:id>12345</bookcase:id>
  <bookcase:capacity>60</bookcase:capacity>
</Bookcase>
 
<Album xmlns:album="http://schemas.microsoft.com/albums">
  <album:id>34567</album:id>
  <album:name>Grand Canyon</album:name>
</Album>
 
<Photo xmlns:photo="http://schemas.microsoft.com/photos">
            <photo:id>162738495</photo:id>
            <album:id>34567</album:id>
            <album:name>Grand Canyon</album:name>
            <photo:description>sunrise over North rim<photo:description>
            <photo:resolution>3.1M<photo:resolution>
</Photo>
Figure 3

Extending Domain-Specific Script Files


/*
// The following should be included at the top of your source file to
// enable "Include" functionality.
 
// At some point, I will enable this to work with the INC environment
// variable.
 
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var f = fso.OpenTextFile("Include.js", 1);
var str = f.ReadAll();
f.close();
eval (str);
 
// Once you have the above, you can use:
eval(Include("Filename"));
 
// OR
 
var fso = WScript.CreateObject("Scripting.FileSystemObject"); 
var f = fso.OpenTextFile("Include.js", 1); 
var str = f.ReadAll(); f.close(); eval (str);
eval(Include("SomeOtherFile.js"));
 
// Of course if all you are going to do is include one file, then
// substitute that filename for "Include.js" instead.
 
*/
 
function Include(Filename)
{
    var str;
    var fsoInclude;
    var otf;
    try
    {
        if (typeof(fso) == "undefined")
        {
            fsoInclude = 
                WScript.CreateObject("Scripting.FileSystemObject");
        }
        else
        {
            fsoInclude = fso;
        }
        otf = fsoInclude.OpenTextFile(Filename, 1);
        str = otf.ReadAll();
    }
    catch(objError)
    {
        WScript.Echo("Error reading the file " + Filename);
        if (objError.name != "Error")
        {
            WScript.Echo("Error name: " +  objError.name);
        }
        WScript.Echo("Error number: " +  objError.number);
        WScript.Echo("Error description: " + objError.description);
        if (objError.message != objError.description)
        {
            WScript.Echo("Error message: " + objError.message);
        }
        throw(objError);
    }
    finally
    {
        if (typeof(otf) != "undefined")
        {
            otf.close();
        }
        fsoInclude = null;
    }
    return str;
}
Show: