On 03/16/2017 10:00 PM, Pierce Tyler wrote:

Thanks so much for offering to look at this! Here's the contents of that
/custom/ directory zipped and attached.


Attached 0docbook.xxe seems to work fine with XXE v7.2+ (I used XXE v7.4 for my tests).

Please make a diff with your own version of this file to learn about the few changes I had to make.

Please note that I've just tried to solve the two issues you have reported. I did not test the compatibility of the other macros you wrote with XXE v7.2+.



<?xml version="1.0" encoding="UTF-8"?>
<configuration mimeType="application/docbook+xml" name="DocBook"
               xmlns="http://www.xmlmind.com/xmleditor/schema/configuration";
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
               xmlns:xs="http://www.w3.org/2001/XMLSchema";
               xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration";>
  <include location="docbook-config:docbook.xxe"/>

  <!-- docbook-xtuple.css -->
  <css alternate="true" location="docbook.css" name="xTuple style"/>
  <windowLayout>
    <center css="xTuple style"/>
  </windowLayout>

  <!-- TODO: create a docb.splitByOS.transformParameters parameterGroup -->
  <!-- it should contain OS: windows, macosx, linux                     -->
  <!--                   UserLevel: installfromsrc installfrompkg       -->
  <!--                   Condition: mingw msvc                          -->
  <menu label="_DocBook"
        insert="ifDefined(XXE.Edition.Unrestricted)after ##last">
    <separator />
    <menu label="Process _xTuple Developer Document">
      <item label="Split into OS-specific files..."
            command="splitByOS.toMultipleXMLFiles" />
    </menu>
  </menu>

  <command name="splitByOS.toMultipleXMLFiles">
    <process>
      <subProcess name="splitByOS" parameter = 'windows installfromsrc mingw' />
      <subProcess name="splitByOS" parameter = 'windows installfromsrc msvc' />
      <subProcess name="splitByOS" parameter = 'windows installfrompkg mingw' />
      <subProcess name="splitByOS" parameter = 'windows installfrompkg msvc' />
      <subProcess name="splitByOS" parameter = 'macosx  installfromsrc ""' />
      <subProcess name="splitByOS" parameter = 'macosx  installfrompkg ""' />
      <subProcess name="splitByOS" parameter = 'linux   installfromsrc ""' />
      <subProcess name="splitByOS" parameter = 'linux   installfrompkg ""' />
      <!-- TODO: automatically open the file.  this read tries to open the file in a new tmpdir -->
      <read file="%{R}_windows_installfromsrc_mingw.xml" encoding="default"/>
    </process>
  </command>

  <command name = "splitByOS" parameters="'%0' '%1' '%2'">
    <process debug="true">
      <transform stylesheet="splitbyos.xsl"
                 file="%{D}"
                 to="%{R}_%{0}_%{1}_%{2}.xml"
                 label="Create OS-specific XML">
        <parameter name="ostofind">%0</parameter>
        <parameter name="userleveltofind">%1</parameter>
        <parameter name="conditiontofind">%2</parameter>
      </transform>
      <upload base="%{p}">
        <copyFiles files="%{R}_%{0}_%{1}_%{2}.xml" toDir="%p" />
      </upload>
    </process>
  </command>

  <!-- change debug to true to keep debugging info after FO->PDF conversion -->
  <command name="docb.toPSFile">
    <process debug="false">
      <subProcess name="docb.toPS" parameter='"%0" "%1"' />
      <upload base="%2">
        <copyFile file="__doc.%0" to="%2" />
      </upload>
    </process>
  </command>

  <!-- tweak to copy images defined in the stylesheet customizations -->
  <command name="docb.toPS">
    <process>
      <mkdir dir="resources" />
      <mkdir dir="raw" />

      <copyDocument to="__doc.xml">
        <resources match="^[a-zA-Z][a-zA-Z0-9.+-]*:/.+" />

        <resources include="text" match=".+" 
                   resolve="true" />

        <resources include="image" 
                   match="(?:.+/)?(.+)\.(png|jpg|jpeg|gif|mml|svg|svgz%1)" 
                   copyTo="resources" referenceAs="resources/$1.$2" />
        <resources include="image" match="(?:.+/)?(.+)\.tex"
                   copyTo="raw" referenceAs="resources/$1.%0" />
        <resources include="image" match="(?:.+/)?(.+)\.(\w+)"
                   copyTo="raw" referenceAs="resources/$1.png" />

        <resources exclude="text image" match=".+" 
                   copyTo="resources" />
      </copyDocument>

      <convertImage from="raw" to="resources" format="%0 png" />

      <mkdir dir="images/callouts" />
      <!-- TODO: when we start using draft mode we'll need svg_images.list -->
      <!--
      <copyProcessResources
          resources="@docbook-config:xsl/images/svg_images.list"
          to="images" />
      -->
      <!-- TODO: when we start using callouts we'll need a svg_callouts.list -->
      <!--
      <copyProcessResources 
          resources="@docbook-config:xsl/images/callouts/svg_callouts.list" 
          to="images/callouts" />
      -->
      <copyProcessResources resources="fo/*.png" to="." />
      <copyProcessResources resources="fo/*.jpg" to="." />

      <transform stylesheet="fo/fo.xsl"
                 file="__doc.xml" to="__doc.fo">
        <info>
          <label>Convert to PDF, PostScript</label>
          <documentation>http://docbook.sourceforge.net/release/xsl/current/doc/fo/%{parameter.name|paper.type}.html</documentation>
          <documentation>http://docbook.sourceforge.net/release/xsl/current/doc/fo/%{attribute-set.name|formal.object.properties}.html</documentation>
          <alternateStylesheet
              location="docbook-config:xsl/fo/docbook.xsl" 
              label="Stock stylesheet" />
          <alternateStylesheet
              location="docbook-config:xsl/fo/profile-docbook.xsl" 
              label="Stock profiling stylesheet" />
          <alternateStylesheets name="docb.toPS.alternateXSLT" />
        </info>

        <parameter name="use.extensions">1</parameter>

        <parameter name="paper.type">USletter</parameter>

        <parameter name="generate.toc">book  toc,title</parameter>
        <parameter name="toc.section.depth">3</parameter>
        <parameter name="section.autolabel">1</parameter>

        <parameter name="callout.graphics">1</parameter>

        <parameter name="shade.verbatim">1</parameter>

        <parameter name="ulink.show">0</parameter>

	<parameterGroup name="docb.toPS.transformParameters" />
      </transform>

      <processFO processor="XEP" file="__doc.fo" to="__doc.%0">
        <parameter name="OUTPUT_FORMAT">%0</parameter>
        <!-- Workaround XEP bug: renderx #22766 -->
        <parameter name="VALIDATE">false</parameter>
        <parameter name="PDF.PDF_VERSION">1.5</parameter>
	<parameterGroup name="docb.toPS.XEPParameters" />

	<!-- If XEP plug-in has not been installed, try FOP plug-in. -->
	<processFO processor="FOP" file="__doc.fo" to="__doc.%0">
	  <parameter name="renderer">%0</parameter>
	  <parameter name="strict-validation">false</parameter>
	  <parameterGroup name="docb.toPS.FOPParameters" />
	</processFO>
      </processFO>
    </process>
  </command>

  <!-- all of the customizations for PS and PDF output are embedded in fo.xsl.
       we could use a parameterGroup here but it's better to keep them
       self-contained.
  <property name="docb.toPS.transform" url="true">fo/fo.xsl</property>
   -->

</configuration>
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to