XML

Adding the Values for the head and body Elements

Now that we have created the template, we can use it to build a Web document. We can now add content for the elements and values for the attributes. To add values to the head and body elements, follow these steps:

  1. Expand the body element, and enter the following value for the title element of the head element: Northwind Traders Help Desk.

  2. Next add values for the body element attributes as shown in the following table:

    Attribute Value
    Text #000000
    Bgcolor #FFFFFF
    Link #003399
    Alink #FF9933
    Vlink #996633

  3. Expand the a element and give the name attribute a value of Top.

  4. Enter the values for the table element attributes shown in the following table:

    Attribute Value
    Border 0
    Width 100%
    Cellspacing 0
    Cellpadding 0

Completing the first row

As shown in Figure 3-3, the first row of our sample table contains the title centered on the page. To accomplish this, follow these steps:

  1. Expand the tr element, and set its valign attribute to Center. Then expand the td element and set its align attribute to Center.

  2. For the colspan attribute of the td element, enter 2 (meaning that the title will span the two columns).

  3. Expand the CellContent element, and enter Table Header for the cellname attribute. Enter Help Desk for the value of the h1 element and Center for the value of its align attribute.


  4. Figure 3-10 shows what the document should look like at this point. You can now collapse this tr section because we have finished with this row.

    Figure 3-10. XML Notepad, showing the completed first row.

Completing the second row

To add a second row, follow these steps:

  1. Click on tr, and then choose Duplicate Subtree from the Insert menu. This will add another tr element, complete with all of its subtrees. Expand the new tr element, and set its valign attribute to Top.

  2. We need two cells in the second row to allow two sets of hyperlink lists in two separate columns. To accomplish this, click on the td element and choose Duplicate Subtree from the Insert menu to add a second td element and all of its subtrees.

  3. We'll begin by working with the first td element. For the align attribute of the first td element, enter Left. Expand the CellContent element, and enter Help Topic List for the cellname attribute. Expand the p element, expand the ul element, and then expand the font element. Enter 3 for the size attribute. For the b element, enter For First-Time Visitors.

  4. Because we want to make hyperlinks to help pages, we will use the a element. Expand the li element, and then expand the a element and enter the value First-Time Visitor Information. For the href attribute of the a element, enter FirstTimeVisitorInfo.htm.

  5. Click on li, and then choose Duplicate Subtree from the Insert menu to add an li element and all of its subtrees. Expand the new li element, and then expand the a element and enter the value Secure Shopping at Northwind Traders. For the href attribute of this a element, enter SecureShopping.htm.

  6. Click on li, and choose Duplicate Subtree from the Insert menu to add a third li element. Expand this li element, expand the a element, and enter the value Frequently Asked Questions. Enter the value FreqAskedQ.htm for the href attribute.

  7. Click on li, and choose Duplicate Subtree from the Insert menu to add a fourth li element. Expand this li element, expand the a element, and enter the value Navigating the Web. Enter the value NavWeb.htm for the href attribute. Figure 3-11 shows the document at this point.

  8. Expand the second td element, and set its align attribute to Left. Expand the CellContent element, and enter the value Shipping Links for the cellname attribute. Expand the p, ul, and font elements, and enter the value Shipping for the b element.

  9. Figure 3-11. XML Notepad, showing the completed first list.

  10. Expand the li element, expand the a element, and enter the value Rates. Enter the value Rates.htm for the href attribute.

  11. Click on li, and choose Duplicate Subtree from the Insert menu to insert a second li element. Expand the new li element, expand the a element, and enter the value Checking on Your Order. For the href attribute, enter the value OrderCheck.htm.

  12. Click on li, and choose Duplicate Subtree from the Insert menu to insert a third li element. Expand the new li element, expand the a element, and enter the value Returns. For the href attribute, enter the value Returns.htm.


  13. Figure 3-12 shows the completed second row.

    Figure 3-12. XML Notepad, showing the completed second list.