Skip to Main Content
Practical PostgreSQL
book

Practical PostgreSQL

by Joshua D. Drake, John C. Worsley
January 2002
Intermediate to advanced content levelIntermediate to advanced
640 pages
16h 39m
English
O'Reilly Media, Inc.
Content preview from Practical PostgreSQL

Understanding LXP Mark-Up

While LXP performs programmatic tasks, one of the aims of LXP is to achieve these tasks without having to change the general syntax that one uses when putting together HTML (or XHTML) mark-up. On the server, an LXP document appears to be a normal HTML file with some unfamiliar tags.

Here is an introductory example of a simple LXP document:

<lxp>
  <dock type="init">
    <include src="parts/init.lxp" />
  </dock>
  <include src="parts/head.html" />

  <h1>Welcome</h1>

  <hr width="400">

  <if lxp.authenticated='t'>
    Welcome to my webpage, <putcookie name="user" />
  </if>
  <else>
    <strong>Please login.</strong>
    >include src="parts/login.lxp" />
  </else>

  <include src="parts/foot.html" />
</lxp>

LXP Tags

A tag (formally called an element) is defined as a structure in a document beginning with a less-than symbol (<) and ending with a greater-than symbol (>). Tags always begin with a name, which defines the nature of the tag, and can optionally have a set of space-delimited attributes. Attributes are always described in the form of a name=value pair, where name is an attribute name unique to that tag, and value is some arbitrary value assigned to that attribute.

All of LXP’s tags follow the same general structure of any mark-up language. Tags begin a region (or block) with an opening tag (e.g., <tag>), and close each region with an associated slash-prefixed closing tag (e.g., </tag>.

As with HTML and XML, some tags do not require closing. These are called empty element tags, and do not ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL: Up and Running, 2nd Edition

PostgreSQL: Up and Running, 2nd Edition

Regina O. Obe, Leo S. Hsu
Learning PostgreSQL 11 - Third Edition

Learning PostgreSQL 11 - Third Edition

Christopher Travers, Andrey Volkov
Learn PostgreSQL

Learn PostgreSQL

Luca Ferrari, Enrico Pirozzi
PostgreSQL 13 Cookbook

PostgreSQL 13 Cookbook

Vallarapu Naga Avinash Kumar

Publisher Resources

ISBN: 9781449309770Supplemental ContentErrata Page