XML technologies / DocBook / Conditional elements (profiling) / Profiling methods / Single-step profiling

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

Single-step profiling eliminates the temporary document: profiling and transformation run in memory. Despite its convenience, keep the following in mind:

  1. This method uses considerable memory. Internal profiling can cause memory problems with large documents. Use two-step profiling in that case.

  2. You need an XSLT processor supporting the EXSLT function exsl:node-set. If unavailable, use another XSLT processor providing exsl:node-set or use two-step profiling.

  3. The filtered document cannot be validated during this process. Ensure that it remains valid after profiling. Test the variants using the stylesheet profiling/profile.xsl to avoid unwanted results.

The following profiling stylesheets generate output in one step:

html/profile-docbook.xsl, xhtml/profile-docbook.xsl

generates a single (X)HTML file

html/profile-chunk.xsl, xhtml/profile-chunk.xsl

generates linked (X)HTML files (for more information, see Generating linked chunks)

fo/profile-docbook.xsl

generates a single XSL-FO file

The two steps required in the previous section can therefore be reduced to one, generating directly HTML:

xsltproc --output profiling-book-lin-001.html \
   --stringparam profile.os "linux" \
   DB/html/profile-docbook.xsl \
   profiling-book-001.xml

  

back to top