6. Examples

Examples of XSieve programs are stored in the folder example. They are executed during make check.

General rules on content of the examples:

Each example is accompanied by documentation:

6.1. Hello, World

This example demonstrates automatic conversion of data from the SXML format to XML.

Example 10. Example of a simple XSieve stylesheet

  xmlns:x = "http://www.w3.org/1999/XSL/Transform"
  xmlns:s = "http://xsieve.sourceforge.net"
  version = "1.0">
<!-- -->

<x:output indent="yes"/>

<x:template match="/">
    '(article (@ (id "hw"))
        (title "Hello")
        (para  "Hello, " (object "World") "!"))


Applying the stylesheet to any XML file gives the following result.

<?xml version="1.0"?>
<article id="hw">
  <para>Hello, <object>World</object>!</para>