<para>Because the OpenPOWER Foundation documentation projects are not self-contained in the
GitHub repositories, forgetting to clone the <literal>Docs-Master</literal> project in addition
to the document project or cloning it in the wrong location is a common problem. Failures of this kind
produce the following error:</para>
<screen>...
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.openpowerfoundation.docs:workgroup-pom:1.0.0-SNAPSHOT (/home/scheel/Docs-Template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact org.openpowerfoundation.docs:master-pom:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
<para>The location within the file of the syntax error. For the above example, the key information is "<literal>lineNumber: 272; columnNumber: 70</literal>.</para>
[ERROR] Failed to execute goal org.openpowerfoundation.docs:openpowerdocs-maven-plugin:1.0.0:generate-webhelp (generate-webhelp) on project openpower-template-guide: Execution generate-webhelp of goal org.openpowerfoundation.docs:openpowerdocs-maven-plugin:1.0.0:generate-webhelp failed: XInclude resource error (sec_template_new_document.xml) and no fallback provided. XProc error err:XD0011: org.xml.sax.SAXParseException; systemId: file:/home/user1/openpower-foundation-docbkx-framework/doc/template/sec_template_new_document.xml; lineNumber: 55; columnNumber: 17; The element type "para" must be terminated by the matching end-tag "</para>". -> [Help 1]
<para>When creating new documentation projects, you may encounter the following error during
your first build:<screen>...
[ERROR] Failed to execute goal org.openpowerfoundation.docs:openpowerdocs-maven-plugin:1.0.5:generate-webhelp (generate-webhelp) on project openpower-vector-programming-guide: Execution generate-webhelp of goal org.openpowerfoundation.docs:openpowerdocs-maven-plugin:1.0.5:generate-webhelp failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
...</screen></para>
<para>This error results from interactions of the maven build process and git. It may be
circumvented by issuing the <userinput>git init</userinput> command in your directory.</para>
<para>FO (formatting objects) validation failures are a slight bit more difficult to identify and require more effort to correct. A sample appears as follows:
<screen>...
Error
SXCH0003: org.apache.fop.fo.ValidationException:
"{http://www.w3.org/1999/XSL/Format}block" is not a valid child of "fo:list-block"!
(See position 70:-1): null:70:-1: "{http://www.w3.org/1999/XSL/Format}block" is not
a valid child of "fo:list-block"! (See position 70:-1)
[ERROR] Failed to execute goal org.openpowerfoundation.docs:openpowerdocs-maven-plugin:1.0.3:generate-webhelp (generate-webhelp) on project hwarch-caia-spec: Failed to transform to PDF: org.apache.fop.fo.ValidationException: "{http://www.w3.org/1999/XSL/Format}block" is not a valid child of "fo:list-block"! (See position 70:-1): null:70:-1: "{http://www.w3.org/1999/XSL/Format}block" is not a valid child of "fo:list-block"! (See position 70:-1) -> [Help 1]
...</screen></para>
<para>The "<literal>org.apache.fop.fo.ValidationException</literal>" text indicates that this error was during FO validation. The key pieces of information are as follows:</para>
this file name, you will find it in the <literal><includes></literal> tag in the <literal>pom.xml</literal> file.</para>
<para>Once all information has been pulled into the working XML file, the XML statements are transformed into FO statements
in preparation for building the PDF. This step generates a <literal>.fo</literal>
file which can be found in the <literal>.../target/docbkx/autopdf/</literal> directory and typically has the same base file name as
the target PDF file. Again, the <literal>pom.xml</literal> file will clarify this name with the <literal><pdfFilenameBase></literal>
variable.</para>
<para>If one locates and opens the .fo file, it becomes obvious that it was intended as a working file and is not readily readable. Therefore, the first
step to understanding this error is to make the FO file more readable.
The <literal>xmllint</literal> tool can be used to create a more readable FO file. Assuming you have been
working in the document directory, the follow steps can be used to produce a more readable XML file:
<para>For your invocation of <literal>xmllint</literal>, substitute <literal>infile</literal> with the name of the Maven-generated
.fo file for your new project and pick a new <literal>outfile</literal> for the new .fo file.</para>
<note><para>The <literal>xmllint</literal> utility may need to be loaded on your system. On an Ubuntu Linux system,
this utility is provided in the <literal>libxml2-utils</literal> package. To locate the proper package for your system,
you may need to reference Google.</para></note>
<para>Now, with a nicely formatted FO file, we can re-invoke the FO Processor (FOP) directly and achieve a more readable error. To do this, invoke
<literal>fop</literal> as follows:<screen><prompt>$ </prompt><userinput>fop -fo fofile and -pdf pdffile</userinput>
Rendered page #1.
Rendered page #2.
Rendered page #3.
Rendered page #4.
Rendered page #5.
Rendered page #6.
Rendered page #7.
Exception
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:block" is not a valid child of "fo:list-block"! (See position 7830:112)
<prompt>$</prompt></screen></para>
<para>As expected, the FOP again reports an exception. However, this time the position information appears more complete. With this new information
and a nicely formatted .fo file, one can find the format statements in error, find the context for the error, and then locate the correct source
DocBook (XML) file. With this information, one can inspect the document source to decide if the error is bad DocBook syntax or a tooling bug. If the latter,
please save the newly formatted .fo file and include it in the bug writeup.</para>