SPFE Documentation | Collections > SPFE Development > How does the SPFE Open Toolkit work?
How does the SPFE Open Toolkit work?
The SPFE Open Toolkit is a system for transforming structured content to produce output in a desired format. It works by processing source XML through a series of stages to produce the output:
-
The synthesis stage collects source topics, pulling content together for further processing.
-
The presentation stage organizes and links topics, structuring content as needed for a particular output format.
-
The formatting stage produces an XML representation of the format. If the output format is an XML format, such as XHTML, this will be the final stage.
-
The encoding stage transforms the XML representation to the output format when that format, such as PDF, is not XML.
Understanding the SPFE build process will help you use the toolkit and resolve problems when they occur.
Synthesis stage
The synthesis stage collects and identifies each component of content to ensure that it's available for the build. References and conditionals are resolved, fragments and other objects imported, and content from external sources is extracted. The synthesis stage also creates a table of contents and link catalog for each topic set.
Link catalogs identify topics for subject-affinity linking. Each topic set is processed in the order listed in the content set configuration. The order is signficant, because the link catalogs produced for each topic set are available when processing subsequent topic sets for soft linking.
The synthesis stage produces an XML file for each topic set with the synthesis output of its topic's content, content-set-id/build/topic-sets/<topic-set-id>/resolve/out/synthesis.xml , a link-catalog file, content-set-id/build/link-catalogs/<topic-set-id>.link-catalog.xml , and table-of-contents file, content-set-id/build/tocs/<topic-set-id>.toc.xml .
Presentation stage
The presentation stage organizes and prepares topics for presentation in the selected output format. The preparation here is structural; actual formatting occurs in next stage. Here, the build process interprets each topic's metadata according to its topic type that's set by its XML Schema and maps the topic structure into structures appropriate for the output media. If there are problems with the topic source structure, they will show up here.
The presentation stage also resolves subject-affinity links. Using the link catalogs created during the synthesis stage, soft links in source topics become actual links.
The presentation stage produces an XML for each topic set with stage output for content in the file content-set-id/build/topic-sets/<topic-set-id>/presentation-<type>/out/presentation.xml .
Formatting stage
The formatting stage produces each content page in an XML representation of the output format. If the output format is XML, such as XHTML, then this will be the final stage.
The formatting stage does not create its output in the build directory. Rather, output content is created in the directory $SPFE_BUILD_DIR/<content-set-id>/output .
Encoding stage
If the output format is other than XML, such as PDF, then the XML produced in the formatting stage will be encoded here.