Front and Center: Formatting with XPath

You already know that Data Views are created using XSL and XSLT. What you might not know is that the data returned by a Data View can be formatted using another technology known as XML Path Language, or XPath.

XPath is a standards-based language designed to allow a developer to easily refer to specific elements in an XML file. However, XPath also allows the developer to use expressions and functions to act upon XML elements.

FrontPage uses XPath to format specific data in a Data View. As a user of FrontPage, you don't have to know anything at all about XPath. FrontPage will generate the necessary XPath code for you based on options you choose in the user interface.

Suppose that you want to format the UnitPrice field as currency. You can do so as follows:

  1. Open a Web page on which you have a Data View displaying the UnitPrice field.

  2. Click once on one of the values in the UnitPrice field. The value will be bordered by a yellow border when it is selected.

  3. Right-click on the value and select Format Item as, Currency from the menu to display the Format Number dialog box as shown in Figure 38.42.

    Figure 38.42. The Format Number dialog box is a WYSIWYG editor for XPath.

    graphics/38fig42.gif

  4. Change the options as desired or click OK to accept the defaults.

The UnitPrice field is now formatted as a currency value, and FrontPage is applying that formatting using XPath.

The Format Item as menu item will contain different options based on what type of field you have selected. For example, if you have selected a field that consists of text, the options on the Format Item as menu are Text, Boolean, Hyperlink, and Picture.

Using XPath, FrontPage makes it easy to format your Data View just the way you want it.



Special Edition Using Microsoft Office FrontPage 2003
Special Edition Using Microsoft Office FrontPage 2003
ISBN: 0789729547
EAN: 2147483647
Year: 2003
Pages: 443

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net