xslbook-blocks Ver 0.1

A XSL library for basic block elements.
This library provides match templates to display HTML block elements (e.g. <p>).

Copyright (C) xslet project.
MIT License.

About xslbook-blocks

xslbook-blocks is a XSL library which is one of parts of xslbook. This library includes XSLT match templates which displays commonly used HTML block elements.

xslbook has a policy that single character elements are basically assigned to commonly used inline elements. <p>, which expresses a paragraph, is a block element. However, this element are frequently used and there is a HTML element which has same name and same use. So <p> is assigned to a paragraph ecceptionally.

All elements provided by this library supports data operations with elements provided by xslbook-do library. All elements can display values of specified nodes in same or another XML file, and can use conditional branchings or repetitions.

Usage

This section explains how to import xslbook-blocks and call its templates in your XSL application or library.

Import xslbook-blocks

To import xslbook-blocks.xsl into another XSL file, the following handworks are needed. Since xslbook-blocks depends on some xslet libraries, they are needed to import, too.

  1. Add the namespace declarations of xslbook and xslutil in a XSL file.

    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:ut="https://github.com/xslet/2020/xslutil"
      xmlns:book="https://github.com/xslet/2020/xslbook"> <!-- This! -->
      ...
  2. Add a import element of xslbook-blocks in the XSL file.

      ...
      <!-- dependency XSL files are already imported in xslbook-blocks.xsl -->
      <xsl:import href="./xslbook-blocks.xsl"/>
      ...

APIs

Since xslbook-blocks is a XSL library, this API document can be generated with xsldoc.
The generated API document is here.

Tests & Samples

This section provides the result of unit tests and samples of match/named templates written in the API documents.

Samples

  1. <p>

Links

xslbook-blocks depends on following xslet library.

XSLT and XPath is the specifications specified by W3C. xslbook-blocks uses XSLT version 1.0 and XPath version 1.0 in it because Web browsers support them.

In addition, xslbook-blocks uses XSLT version 3.0 and XPath version 3.0 in the build environment.

xslbook-blocks also uses the following application as tools in the build environment.