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>
     </fragment>
   </section>
   <section id="content">
     <fragment id="2">
       <para>[your first paragraph]</para>
       <!-- more PSML content here... -->
     </fragment>
   </section>
</document>

Table model

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

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

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">
      <value>English</value>
      <value>Spanish</value>
    </property>
    <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"/>
    </property>
  </properties-fragment>
 </section>

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>
   </xref-fragment>
</section>

Created on , last edited on