On 07/20/2012 05:35 PM, Stefan Seefeld wrote:
>
> in an attempt to allow me to choose among different stylesheets for PDF
> conversion, I have written this configuration:
>
> <command name="db5.chooseStylesheet">
>     <macro>
>       <sequence>
>         <command name="pick"
>                  parameter="'Please choose a stylesheet' true
>                             'OMG spec'
>                             'omg/fo.xsl'
>                             'IEEE paper'
>                             'ieee/fo.xsl'
>                             'Normal Stylesheet'
>                             'xsl/fo/docbook.xsl'" />
>
>         <get expression="sys:setProperty('db5.toPS.transform', '%c/%_')"
>              xmlns:sys="java:java.lang.System"/>
>       </sequence>
>     </macro>
>   </command>
>
>   <command name="db5.convertToPS">
>     <macro>
>       <sequence>
>         <command name="db5.chooseStylesheet" />
>         <command name="selectConvertedFile"
>                  parameter="saveFileURLWithExtension=%0" />
>         <command name="db5.toPSFile"
>                  parameter='"%0" "%1" "%2" "%3" "%_"' />
>       </sequence>
>     </macro>
>   </command>
>
> This appears to run fine, till after FOP has completed. Right at the
> end, xxe raises this java error:
>
> Command execution failed:
> java.net.MalformedURLException: no protocol: %2
>
> I assume I'm passing the wrong parameter in one of the above commands,
> but I can't figure out where.
>

[My answer applies to XXE v5.3. I don't know if this is the case with 
earlier releases. May be. May be not.]



--> The documentation of db5.toPSFile is displayed by invoking:

convertdoc -h db5.toPSFile

---
convertdoc [options] db5.toPSFile docbook_file_or_URL \
   -s pdf -s "|pdf" -u pdf_file_or_URL

   Convert DocBook document docbook_file_or_URL to PDF file pdf_file_or_URL.

   Example:
   convertdoc db5.toPSFile doc.xml -s pdf -s "|pdf" -u out/doc.pdf

convertdoc db5.toPSFile docbook_file_or_URL \
   -s ps -s "|eps|ps" -u ps_file_or_URL

   Convert DocBook document docbook_file_or_URL to PostScript file
   ps_file_or_URL.

   Example:
   convertdoc db5.toPSFile doc.xml -s ps -s "|eps|ps" -u out/doc.ps
---

See "The convertdoc command-line tool"
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/convertdoc.html



--> Therefore:

[1] You need to rewrite your db5.convertToPS as follows:

---
  <command name="db5.convertToPS">
    <macro>
      <sequence>
        <command name="db5.chooseStylesheet" />
        <command name="selectConvertedFile"
                 parameter="saveFileURLWithExtension=%0" />
        <command name="db5.toPSFile"
                 parameter='"%0" "%1" "%_"' />
      </sequence>
    </macro>
  </command>
---

[2] db5.convertToPS must be invoked (normally; as this is the case in 
the stock configuration) as follows:

---
       <item label="Convert to _PDF..."
             command="db5.convertToPS"
             parameter="pdf |pdf" />
---



--> As of v5.3, there is a simpler, albeit slightly different in its 
operation, way to achieve the feature you want:

[a] Add this to your DocBook 5 customization:

---
<property name="db5.toPS.alternateXSLT.base" url="true">.</property>

<!-- Title/URI pairs separated by a newline character -->
<property name="db5.toPS.alternateXSLT">
OMG spec
omg/fo.xsl
IEEE paper
ieee/fo.xsl
</property>
---

[b] Select the stylesheet you want by using "Options|Customize 
Configuration|Customize Document Conversion Stylesheets", "Convert to 
PDF, PostScript" section.

See 
http://www.xmlmind.com/xmleditor/_distrib/doc/help/ConversionStylesheetsEditor_reference.html

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

Reply via email to