jguilloux at arkoon.net wrote:
> I have a problem : I wish to convert XML files to HTML files.
>  From V2.2, the DocBook menu, added to the menu bar when a DocBook, 
> Simplified DocBook or Slides document is being edited, has a Convert 
> Document sub-menu.
> 
> But, I have 300 XML files to convert !!
> How to make?
> it takes too a long time to open 300 files to convert them with 
> "DocBook" menu.
> Exist there a means of doing that in command line (Linux Shell) ?

Here I assume that your 300 XML files are DocBook or Simplified DocBook.

2 solutions:

[1] You can write a shell script emulating what is done by the Convert 
submenu.

Here is what you need to emulate (see 
XXE_install_dir/config/docbook/xslMenu.incl). That is, just use this as 
a spec:

---
     <process>
       <mkdir dir="resources" />
       <!-- add attribute selection="true" to copyDocument if you want
            to be able to process explicitely selected element -->
       <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/html/chunk.xsl"
                  file="__doc.xml" to="__doc.html" >
         <parameter name="base.dir">%W%S</parameter>
         <parameter name="chunk.first.sections">1</parameter>
         <parameter name="chunk.section.depth">1</parameter>

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

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

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

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

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

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

[2] OR You may want to try XMLmind FO Converter - XSL Utility (download 
from http://www.xmlmind.com/foconverter/downloadperso.shtml).

It comes with both a GUI version and *a command line version* and it can 
be used to convert DocBook to HTML. See 
http://www.xmlmind.com/foconverter/_distrib/docs/xslutility/



Reply via email to