Class PatchDocbookMojo
java.lang.Object
network.ike.docs.plugin.PatchDocbookMojo
- All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo
@Mojo(name="patch-docbook",
defaultPhase="generate-resources")
public class PatchDocbookMojo
extends Object
implements org.apache.maven.api.plugin.Mojo
Patch stock DocBook XSL stylesheets to suppress Saxon warnings.
Applies two targeted fixes to the downloaded DocBook XSL 1.79.2 distribution:
fo/docbook.xsl— removes the direct include of../common/utility.xslwhich creates a diamond import (Saxon SXWN9019: included or imported more than once).fo/math.xsl— removes the dead<xsl:variable name="output.delims">block that is computed but never used (Saxon SXWN9001).
Replaces: patch-docbook-xsl.sh
Usage:
mvn ike:patch-docbook -DdocbookDir=target/docbook-xsl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()protected org.apache.maven.api.plugin.LoggetLog()Access the Maven logger.static StringremoveDeadVariable(String xsl) Remove the dead<xsl:variable name="output.delims">block from DocBook'sfo/math.xsl.static StringRemove the<xsl:include href="../common/utility.xsl"/>line from DocBook'sfo/docbook.xsl.
-
Constructor Details
-
PatchDocbookMojo
public PatchDocbookMojo()Creates this goal instance.
-
-
Method Details
-
getLog
protected org.apache.maven.api.plugin.Log getLog()Access the Maven logger.- Returns:
- the logger
-
execute
public void execute() throws org.apache.maven.api.plugin.MojoException- Specified by:
executein interfaceorg.apache.maven.api.plugin.Mojo- Throws:
org.apache.maven.api.plugin.MojoException
-
removeUtilityInclude
-
removeDeadVariable
Remove the dead<xsl:variable name="output.delims">block from DocBook'sfo/math.xsl.The variable spans multiple lines and is matched with a non-greedy pattern from the opening tag to the closing tag.
- Parameters:
xsl- the XSL content- Returns:
- patched XSL with the dead variable removed
-