Build System XML/Metadata Module


Overview

The Build System XML/Metadata Module provides the build system with the ability to process XML files, including validation and transformation.

Macros and Controls

XML_VALIDATE_CLASS
This is the java class entry point into the default XML validation utility. The value is used to set the default value of the complete validation command line. Defaults to "Validate".

XML_VALIDATE_CP
This is the java classpath passed to the JVM running the validation utility. The value is used to set the default classpath argument in the complete validation command line. Defaults based on having bb-md-validate in the IMPORT_NOARCH_TARGETS list with default import options.

XML_VALIDATE_JAVAFLAGS
This is the extra java command line options passed to the JVM running the validation utility. The value is used in the default version of the complete validation command line. Defaults to "-client" for performance reasons.

XML_VALIDATE_CMD
This is the actual command line used for running the validation utility. The default value builds a command line from the three previous variables. Any command must be able to take exactly two arguments: the schema and the XML to be validated.

XML_TRANSFORM_CLASS
This is the java class entry point into the default XML transform utility. The value is used to set the default value of the complete transform command line. Defaults to "Transform".

XML_TRANSFORM_CP
This is the java classpath passed to the JVM running the transform utility. The value is used to set the default classpath argument in the complete transform command line. Defaults based on having bb-md-validate in the IMPORT_NOARCH_TARGETS list with default import options.

XML_TRANSFORM_JAVAFLAGS
This is the extra java command line options passed to the JVM running the transform utility. The value is used in the default version of the complete transform command line. Defaults to "-client" for performance reasons.

XML_TRANSFORM_CMD
This is the actual command line used for running the transform utility. The default value builds a command line from the three previous variables. Any command must be able to take exactly three arguments: the XSLT script, the XML to be transformed, and the output file.

XML_TRANSFORM_XSL
This variable is used as the default XSLT script used in XML_TRANSFORM_TARGETS if there is no target-specific XSLT script specified. This can be used if many XML files are being transformed the same way in a single Makefile.

XML_TFSPLITXSL
This variable is used as the default XSLT script used in XML_TFSPLIT_TARGETS if there is no target-specific XSLT script specified. This can be used if many XML files are being transformed the same way in a single Makefile.

XML_TFSPLITCMD
This variable is used as the default output splitting used in XML_TFSPLIT_TARGETS if there is no target-specific command specified. This can be used if many XML files are being transformed the same way in a single Makefile.

XML_TFSPLITBXSL
This variable is used as the default XSLT script used in XML_TFSPLIT_TARGETS if there is no target-specific XSLT script specified as %_BASEXSL. This can be used if many XML files are being transformed the same way in a single Makefile.


Targets


XML_VALIDATE_TARGETS

XML_VALIDATE_TARGETS Overview

XML_VALIDATE_TARGETS is the XML schema validation target. This pattern target is used to ensure that an XML file is properly formatted. XML_VALIDATE_TARGETS patten targets will be run during the "pretarget" phase of a build. The general form of the validate command used is as follows:
<java> <java flags> -cp <validate classpath> <validate class> <XML schema> <XML file>

XML_VALIDATE_TARGETS Options

<validate target>_CMD
Override the default validation command line for the current target.

<validate target>_SCHEMA
Set the schema for the current <validate target>.

<validate target>_SRC
Override the default source file location of <validate target>


XML_TRANSFORM_TARGETS

XML_TRANSFORM_TARGETS Overview

XML_TRANSFORM_TARGETS is the XML transformation target. This pattern target is used to apply an XSLT style transform to an XML file XML_TRANSFORM_TARGETS patten targets will be run during the "target" phase of a build. The general form of the transform command used is as follows:
<java> <java flags> -cp <transform classpath> <transform class> <XSLT script> <XML file> <output>

XML_TRANSFORM_TARGETS Options

<transform target>_CMD
Override the default transform command line for the current target.

<transform target>_VALCMD
Override the default validate command line for the current target used in input/output schema validation.

<transform target>_INSCHEMA
If set, check the input XML file against this schema for the current <transform target>.

<transform target>_OUTSCHEMA
If set, check the output XML file against this schema for the current <transform target>.

<transform target>_INCHECK
If set, check the input XML file using this program for the current <transform target>. It should take the input XML file as a single argument.

<transform target>_XSL
Override the default XSLT script file for <transform target>.

<transform target>_SRC
Override the default source file location of <transform target>.

<transform target>_OUTFILE
Override the default destination file location of <transform target>. Defaults to $(BS_NOARCH_TARGET_DIR)/<transform target>.


XML_TFSPLIT_TARGETS

XML_TFSPLIT_TARGETS Overview

XML_TFSPLIT_TARGETS is the XML transformation target. This pattern target is used to apply an XSLT style transform to an XML file XML_TFSPLIT_TARGETS patten targets will be run during the "target" phase of a build. The general form of the transform command used is as follows:
<java> <java flags> -cp <transform classpath> <transform class> <XSLT script> <XML file> <output>

XML_TFSPLIT_TARGETS Options

<tfsplit target>_CMD
Override the default transform command line for the current target.

<tfsplit target>_VALCMD
Override the default validate command line for the current target used in input schema validation.

<tfsplit target>_SCHEMA
If set, check the input XML file against this schema for the current <tfsplit target>.

<tfsplit target>_SPLITXSL
Override the default XSLT script file used to generate the input to the split command for <tfsplit target>

<tfsplit target>_SPLITCMD
Override the default command used to split the output of the %_SPLITXSL transform for <tfsplit target>

<tfsplit target>_BASEOUT
If set, perform a 1-1 transform of the input file into a file in the output directory with this filename for <tfsplit target>

<tfsplit target>_BASEXSL
Override the default XSLT script file used to generate %_BASEOUT file for <tfsplit target>

<tfsplit target>_SRC
Override the default source file location of <tfsplit target>

<tfsplit target>_OUT
Override the default output directory location of <tfsplit target>


xmlmd_validate

xmlmd_validate Overview

Simple target to trigger the building of XML_VALIDATE_TARGETS pattern targets independent of the main build "pretarget" phase.

xmlmd_transform

xmlmd_transform Overview

Simple target to trigger the building of XML_TRANSFORM_TARGETS pattern targets independent of the main build "target" phase.

xmlmd_tfsplit

xmlmd_tfsplit Overview

Simple target to trigger the building of XML_TFSPLIT_TARGETS pattern targets independent of the main build "target" phase.

xmlmd_info

xmlmd_info Overview

Simple target to display information about the macro settings of all global macros used by the XML/metadata module of the build system. The xmlmd_info target will be built during the "info" phase of a build, and can be built in isolation by requesting the xmlmd_info target.

xmlmd_man

xmlmd_man Overview

Simple target to display usage information and help pertaining to the XML/metadata module of the build system. The xmlmd_man target will be built during the "man" phase of a build, and can be built in isolation by requesting the xmlmd_man target.

Example Makefile


# The source root of this Component
COMPONENT_ROOT=../..

# The root of the build system
BS_ROOT=$(COMPONENT_ROOT)/build3

# Boostrap Build system definitions.
include $(BS_ROOT)/defines.mk

# validate an XML file
XML_VALIDATE_TARGETS=bb-event.xml
bb-event.xml_SCHEMA=md_2.0-PPEM.xsd
bb-event.xml_SRC=bb-event-PPEM.md

# split an XML file into multiple HTML files
XML_TFSPLIT_TARGETS=bbeventhtml
bbeventhtml_SRC=bb-event-PPEM.md
bbeventhtml_SPLITXSL=md2html.xsl
bbeventhtml_SPLITCMD=md2html.pl
bbeventhtml_BASEOUT=bb-event.xml
bbeventhtml_BASEXSL=md_trim.xsl

# Finally, include the rules to make the build system go.
include $(BS_ROOT)/rules.mk