David Cramer (Tech Pubs) wrote:
> Doh! I'd forgotten to change the macro to call the new eclipse command. 
> 
>     <command name="docb.convertToEclipse">
>     <macro>
>       <sequence>
>       <command name="selectFile" parameter="saveDirectoryURL" />
>       <command name="docb.toHTML" parameter='"%_"' />
>                       <!--^^^^^^-->
>       <!-- I'd forgotten to change this to docb.toEclipse -->
>       </sequence>
>     </macro>
>   </command>
> 
> Now it's generating the plugin.xml and eclipse.xml files, but putting them in 
> C:\programs\XMLmind_XML_Editor due to a limitation of the docbook xsls that 
> generate eclipse stuff. I'm trying to debug that by putting an xsl:message 
> terminate="yes" to get the value of $base.dir, but the error window doesn't 
> appear to give me the output of the message. It just says processing was 
> terminated by xsl:message.

In my version (DocBook XSL style sheets 1.62.0), it is generating 
plugin.xml and toc.xml files in current working directory. Moreover 
toc.xml contains absolute references to the temporary directory used by 
XXE during file generation.

I found a quick and dirty workaround for all these problems:

(It is of course cleaner to fix the bugs in eclipse.xsl and send the 
patches to Norman Walsh.)

---
<command name="docb.toEclipse">
   <process>
     <mkdir dir="resources" />
     <copyDocument to="__doc.xml">
       <resources match="(https|http|ftp)://.*" />
       <resources match=".+" copyTo="resources" />
     </copyDocument>

     <mkdir dir="callouts" />
     <copyProcessResources
        resources="@xsl/images/callouts/gif_callouts.list"
        to="callouts" />

     <copyProcessResources resources="xsl/css/html.css"
                          to="html.css" />

     <transform stylesheet="xsl/eclipse/eclipse.xsl"
               file="__doc.xml" to="__doc.html" >
       <parameter name="base.dir">%W%S</parameter>
       <parameter name="chunk.first.sections">0</parameter>
       <parameter name="chunk.section.depth">100</parameter>

       <parameter name="toc.section.depth">3</parameter>
       <parameter name="section.autolabel">1</parameter>

       <parameter name="html.stylesheet">html.css</parameter>

       <parameter name="callout.graphics">1</parameter>
       <parameter name="callout.graphics.path">callouts/</parameter>
       <parameter name="callout.graphics.extension">.gif</parameter>
     </transform>

     <!-- The real Eclipse file is index.html -->
     <delete files="__doc.*" />

     <shell command="sed -e 's^%W%S^^g' toc.xml > %W%Stoc.xml"
           platform="Unix" />
     <shell command="rm toc.xml" platform="Unix" />
     <shell command="mv plugin.xml %W" platform="Unix" />

     <upload base="%0/">
       <copyFiles files="*.*" toDir="." />
       <copyFiles files="resources/*" toDir="resources" />
       <copyFiles files="callouts/*" toDir="callouts" />
     </upload>
   </process>
</command>

<command name="docb.convertToEclipse">
   <macro>
     <sequence>
       <command name="selectFile" parameter="saveDirectoryURL" />
       <command name="docb.toEclipse" parameter='"%_"' />
     </sequence>
   </macro>
</command>
---

I've added 3 <shell> elements. You need to adapt them to Windows. The 
idea  is that for the shell (/bin/sh or cmd.exe), "plugin.xml" means 
"plugin.xml in current working directory".

<shell> element is described in 
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s04s02.html#process


Reply via email to