Examples of XSieve programs are stored in the folder example
. They are executed during make check
.
General rules on content of the examples:
the base name of an XSieve program is the same as the folder name,
names of the input files are started with input
, and
names of the output files are started with output
.
Each example is accompanied by documentation:
index.xml
is the documentation source in the DocBook format, and
index.html
is the generated HTML file.
This example demonstrates automatic conversion of data from the SXML format to XML.
Example 10. Example of a simple XSieve stylesheet
<x:stylesheet xmlns:x = "http://www.w3.org/1999/XSL/Transform" xmlns:s = "http://xsieve.sourceforge.net" extension-element-prefixes="s" version = "1.0"> <!-- --> <x:output indent="yes"/> <x:template match="/"> <s:scheme> '(article (@ (id "hw")) (title "Hello") (para "Hello, " (object "World") "!")) </s:scheme> </x:template> </x:stylesheet>
Applying the stylesheet to any XML file gives the following result.
<?xml version="1.0"?> <article id="hw"> <title>Hello</title> <para>Hello, <object>World</object>!</para> </article>