Sample Code

Some code samples

PSML sample document

PageSeeder Markup Language example markup

Following are some PSML code samples that can be used as templates for development.

Basic PSML document

The basic structure of a PSML document with placeholders:

<?xml version="1.0" encoding="UTF-8"?>
<document level="portable" [type="[your document type]"]>
   <section id="title">
     <fragment id="1">
       <heading level="1">[your document title]</heading>
   <section id="content">
     <fragment id="2">
       <para>[your first paragraph]</para>
       <!-- more PSML content here... -->

Table model

Below is an example of the new table model introduced in PSML Beta 7.

  <col width="200px"/>
  <col width="100px"/>
  <row part="header">
    <cell>Alice's Adventures in Wonderland</cell>
    <cell>Lewis Carol</cell>
    <cell>Gulliver's Travels</cell>
    <cell>Jonathan Swift</cell>

Properties fragment

A simple properties fragment. This specialized fragment comes as a replacement for the 'pslabelvalues' section type used in PS Standard.

<section id="metadata">
  <properties-fragment id="4" >
    <property name="title" title="Title" value="Alice's Adventures in Wonderland"/>
    <property name="isbn" title="ISBN" value="0000000000001"/>
    <property name="author" title="author" value="Lewis Caroll"/>
    <property name="language" title="language">
    <property name="country" title="country" value="Australia"/>
    <property name="available-date" datatype="date" title="available-date" value="2012-01-01"/>
    <property name="related" count="n" datatype="xref" title="related">
      <xref href="book4.psml" frag="default"/>
      <xref href="book7.psml" frag="default"/>

Cross reference fragment

A simple fragment listing cross references. This specialized fragment comes as a replacement for the 'psxreflist' section type used in PS Standard.

<section id="links">
   <xref-fragment id="5">
    <blockxref href="chapter1.psml" frag="default">Chapter 1: Down the Rabbit-Hole</blockxref>
    <blockxref href="chapter2.psml" frag="default">Chapter 2: The Pool of Tears</blockxref>

Created on , last edited on