docbook-apps

  • 1.  xlstproc questions (was: CSS begging)

    Posted 05-16-2009 16:11
    Johann (and Dave and Fabrice), thank you! I am now able to demo "and
    this is what it looks like, styled" -- which is very useful. I will
    put my slides on Slideshare early next week.

    I told myself that would be my last question before Wednesday's talk
    but the mention of xsltproc raised questions about its use as well. (I
    am using both free tools such as xsltproc and xmlmind side-by-side
    with oXygen so I can demonstrate some choice in tool selection. Most
    but not all people at this demo will be working in Windows and like
    me, will start with free tools.)

    For Windows users, is it common usage to create a batch file for
    xsltproc that substitutes as a kind of Makefile to document processes?

    Also, I had trouble with DOS path names in my xsltproc commands and
    the Windows (really, DOS...) guidance for xsltproc I found on the web
    seemed vague.

    This:

    C:\XMLTOOLS>xsltproc --stringparam base.dir c:\XMLTOOLS\test7-
    --stringparam html.stylesheet boetest.css
    c:\xmltools\docbook-xsl\xhtml\chunk.xsl
    h:\docsrepo\TechRef\JSONGrammar.xml

    produced a strange long filename... if I left off the path that didn't
    happen. If I changed the path, say, to h:\test\results\test8- the file
    stayed in teh directory with another strange long filename, like the
    other, concatenated from the path.Obviously, there's a right way to
    express the path and that isn't it.

    Finally, if anyone has really precise instructions for permanently
    setting the path for xsltproc, that would be great. Most directions on
    the Web are vague (try googling: your computer's environment variable
    xsltproc) and I had to ask a couple of friends who like me hadn't done
    anything like this in, oh... a decade.

    --
    --
    | Karen G. Schneider
    | Community Librarian
    | Equinox Software Inc. "The Evergreen Experts"
    | Toll-free: 1.877.Open.ILS (1.877.673.6457) x712
    | kgs@esilibrary.com
    | Web: http://www.esilibrary.com
    | Be a part of the Evergreen International Conference, May 20-22, 2009!
    | http://www.lyrasis.org/evergreen



  • 2.  Re: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-16-2009 16:46
    Karen Schneider wrote:

    > For Windows users, is it common usage to create a batch file for
    > xsltproc that substitutes as a kind of Makefile to document processes?
    >
    > Also, I had trouble with DOS path names in my xsltproc commands and
    > the Windows (really, DOS...) guidance for xsltproc I found on the web
    > seemed vague.

    I found Windows path names so odd, that I stayed with Java,
    which lets me use / as the path separator, hence reducing
    the complexity.
    Basic advice. Use a setup that has *no* spaces in all the pathnames.




    > Finally, if anyone has really precise instructions for permanently
    > setting the path for xsltproc, that would be great. Most directions on
    > the Web are vague (try googling: your computer's environment variable
    > xsltproc) and I had to ask a couple of friends who like me hadn't done
    > anything like this in, oh... a decade.

    I haven't used xsltproc for XSLT transforms, just Daniels software
    for xInclude.

    I will try and do a shell script version of my setup, but I doubt
    it will be ready in the next day or two.

    (Then it's liable to be bash, I doubt I could get a Windows setup
    working with the Dos shell!)



    regards

    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    http://www.dpawson.co.uk



  • 3.  Re: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-16-2009 18:51
    Karen

    Setting the PATH should probably be done in your batch file:

    SET PATH=c:\rubberducky\xslttools;%PATH%

    This sets your own dir for xsltproc ahead of the rest of the system's paths (i.e. %PATH%).

    You can also set it permanently via "Start => Control Panel => System => Advanced => Environment Variables" and then edit the paths similar to above.

    I use a batch file to set all of my XSLTPROC command line parameters so I can use the same parameters every time. I'm not as young as I used to be and don't remember command line switches that I don't use every day.

    Regards,
    Dean Nelson

    -----This is an example of an FO and HTML output from XSLTPROC ----
    @SET PATH=c:\rubberducky\xslttools;%PATH%
    @set MASTER_DOC=myDocbookFile
    @set STYLE_PDF=myFOStylesheetFile
    @set STYLE_HTML=myHTMLStylesheetFile

    @set XSLTPROC_SHOWVERSION= --version
    @set XSLTPROC_TIMING= --timing
    @set XSLTPROC_NOVALID= --novalid
    @set XSLTPROC_XINCLUDE= --xinclude
    @set XSLTPROC_NET= --nonet
    @set XSLTPROC_PARAMS= --param use.extensions 0

    @set XSLTPROC_COMMAND=XSLTPROC %XSLTPROC_NET% %XSLTPROC_SHOWVERSION% %XSLTPROC_TIMING% %XSLTPROC_XINCLUDE% %XSLTPROC_PARAMS%

    @REM -- This command calls XSLTPROC for FO -----
    %XSLTPROC_COMMAND% -o %MASTER_DOC%.fo %STYLE_PDF%.xsl %MASTER_DOC%.xml

    @REM -- This command calls XSLTPROC for HTML -----
    %XSLTPROC_COMMAND% %STYLE_HTML%.xsl %MASTER_DOC%.xml

    -----



    In a message dated 05/16/09 10:46:17 Pacific Daylight Time, davep@dpawson.co.uk writes:
    Karen Schneider wrote:

    > For Windows users, is it common usage to create a batch file for
    > xsltproc that substitutes as a kind of Makefile to document processes?
    >
    > Also, I had trouble with DOS path names in my xsltproc commands and
    > the Windows (really, DOS...) guidance for xsltproc I found on the web
    > seemed vague.

    I found Windows path names so odd, that I stayed with Java,
    which lets me use / as the path separator, hence reducing
    the complexity.
    Basic advice. Use a setup that has *no* spaces in all the pathnames.




    > Finally, if anyone has really precise instructions for permanently
    > setting the path for xsltproc, that would be great. Most directions on
    > the Web are vague (try googling: your computer's environment variable
    > xsltproc) and I had to ask a couple of friends who like me hadn't done
    > anything like this in, oh... a decade.

    I haven't used xsltproc for XSLT transforms, just Daniels software
    for xInclude.

    I will try and do a shell script version of my setup, but I doubt
    it will be ready in the next day or two.

    (Then it's liable to be bash, I doubt I could get a Windows setup
    working with the Dos shell!)



    regards

    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    http://www.dpawson.co.uk

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



  • 4.  Re: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-16-2009 19:00
    On Sat, May 16, 2009 at 2:50 PM, DeanNelson <deannelson@aol.com> wrote:
    > Karen
    >
    > Setting the PATH should probably be done in your batch file:
    >
    > SET PATH=c:\rubberducky\xslttools;%PATH%


    This strikes me as a valuable approach for several reasons...
    multiplied across a community, it would be a good way to troubleshoot
    problems -- and for that matter reduce problem and increase
    consistency through explicit guidance.

    --
    --
    | Karen G. Schneider
    | Community Librarian
    | Equinox Software Inc. "The Evergreen Experts"
    | Toll-free: 1.877.Open.ILS (1.877.673.6457) x712
    | kgs@esilibrary.com
    | Web: http://www.esilibrary.com
    | Be a part of the Evergreen International Conference, May 20-22, 2009!
    | http://www.lyrasis.org/evergreen



  • 5.  Re: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-16-2009 18:35
    Karen Schneider wrote:

    > C:\XMLTOOLS>xsltproc --stringparam base.dir c:\XMLTOOLS\test7-
    > --stringparam html.stylesheet boetest.css
    > c:\xmltools\docbook-xsl\xhtml\chunk.xsl
    > h:\docsrepo\TechRef\JSONGrammar.xml

    base.dir must have trailing slash (or backslash)

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 6.  Re: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-16-2009 18:50
    2009/5/16 Jirka Kosek <jirka@kosek.cz>:
    > Karen Schneider wrote:
    >
    >> C:\XMLTOOLS>xsltproc --stringparam base.dir c:\XMLTOOLS\test7-
    >> --stringparam html.stylesheet boetest.css
    >> c:\xmltools\docbook-xsl\xhtml\chunk.xsl
    >> h:\docsrepo\TechRef\JSONGrammar.xml
    >
    > base.dir must have trailing slash (or backslash)

    Then am I reading the table incorrectly for Stayton, DocBook XSL, p.
    64? "If you omit the trailing slash, then the chunk filename is
    appended to the value without a slash separator, effectively adding it
    as a prefix to each chunk filename. You can also combine a prefix and
    a directory name, as shown in the third example below."

    base.dir="htmlout/refbook-" seems equivalent to c:\XMLTOOLS\test7-
    (I assumed the quotation marks were not intended in the actual
    command)

    See: http://www.sagehill.net/docbookxsl/Chunking.html#ChuckFilenamePrefix

    (Chuck? :) )

    I have been working on the same six or seven files for most of today
    so I apologize if I'm being obtuse...

    --
    --
    | Karen G. Schneider
    | Community Librarian
    | Equinox Software Inc. "The Evergreen Experts"
    | Toll-free: 1.877.Open.ILS (1.877.673.6457) x712
    | kgs@esilibrary.com
    | Web: http://www.esilibrary.com
    | Be a part of the Evergreen International Conference, May 20-22, 2009!
    | http://www.lyrasis.org/evergreen



  • 7.  RE: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-18-2009 16:48
    We use Apache Ant to control builds. It is possible to use it directly to invoke a transform (using the XSLT task). By default, Xalan is bound as the XSLT transform engine, but it can be replaced with Saxon fairly easily. A big advantage it has is working cross-platform, which is important because we have users on Linux and HP-UX in addition to Windows. You can also execute command on the command line using the exec task.

    Everything is based on the idea of targets that perform specific function and are built of tasks. It is pretty straightforward for simple things like a single transform invocation, but provides enough sophistication to handle sequencing processing transforms and packaging up results into ZIP files with the HTML and the image files combined into a destination directory and then collected into a ZIP file.

    Another thing useful is it is XML, so the same editors used for content can be used to modify the file that controls the build process. We also have some build processes for advanced functions that create a new build file on the fly using XSLT and then transfer control to it for a part of the build. This makes it very powerful.

    For people who don't like the command line, we provide simple .bat files that invoke specific targets in the build (targets are what get executed in Ant) so that the user can just double-click on build.bat and build-to-validate.bat without having to go to the command line on Windows. Most UNIX users don't feel the need for shell scripts to launch the Ant builds and prefer to do so from the command line to have the added flexibility that the command line gives of defining some parameters to the build when it is invoked.

    The manual for Apache is available online at http://ant.apache.org/manual/index.html

    In the left-hand navigation, click on "Ant Tasks," then "Core Tasks" and "XSLT/Style" will be at the bottom of the navigation column.

    Larry Rowland




  • 8.  Re: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-18-2009 17:57
    Rowland, Larry wrote:
    > We use Apache Ant to control builds. It is possible to use it directly to invoke a transform (using the XSLT task). By default, Xalan is bound as the XSLT transform engine, but it can be replaced with Saxon fairly easily. A big advantage it has is working cross-platform, which is important because we have users on Linux and HP-UX in addition to Windows. You can also execute command on the command line using the exec task.
    >
    > Everything is based on the idea of targets that perform specific function and are built of tasks. It is pretty straightforward for simple things like a single transform invocation, but provides enough sophistication to handle sequencing processing transforms and packaging up results into ZIP files with the HTML and the image files combined into a destination directory and then collected into a ZIP file.
    >
    > Another thing useful is it is XML, so the same editors used for content can be used to modify the file that controls the build process. We also have some build processes for advanced functions that create a new build file on the fly using XSLT and then transfer control to it for a part of the build. This makes it very powerful.
    >
    > For people who don't like the command line, we provide simple .bat files that invoke specific targets in the build (targets are what get executed in Ant) so that the user can just double-click on build.bat and build-to-validate.bat without having to go to the command line on Windows. Most UNIX users don't feel the need for shell scripts to launch the Ant builds and prefer to do so from the command line to have the added flexibility that the command line gives of defining some parameters to the build when it is invoked.
    >
    > The manual for Apache is available online at http://ant.apache.org/manual/index.html
    >
    > In the left-hand navigation, click on "Ant Tasks," then "Core Tasks" and "XSLT/Style" will be at the bottom of the navigation column.
    >
    > Larry Rowland

    I've now finished my first pass at a tutorial using ant.
    I'll be moving it on my website, but for now it is at
    http://www.dpawson.co.uk/docbooksetup/html/

    It contains a fairly comprehensive docbook ant script, also functionally
    duplicated as a bash script.

    HTH



    regards

    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    http://www.dpawson.co.uk



  • 9.  Re: [docbook-apps] xlstproc questions (was: CSS begging)

    Posted 05-19-2009 01:32

    On 2009-05-16 , at 12:10:57, Karen Schneider wrote:

    > For Windows users, is it common usage to create a batch file for
    > xsltproc that substitutes as a kind of Makefile to document processes?

    When I was using Windows, I used Cygwin and GNU Make rather than .BAT
    files.
    ________________________________________________________________________

    Bill Greene
    http://www.linkedin.com/in/williamrgreene
    http://bill2u.wordpress.com/