Actually, I meant that you would look into the xslts to see how they
currently format formalparas:
http://docbook.sourceforge.net/release/xsl/current/xhtml/block.xsl
 
And the be inspired by that code to write a customization layer:
http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLayer
 
In the customization layer you would create new templates that handle
varlistentrys. For this you would be inspired by the variablelist and
varlistentry-related templates in
http://docbook.sourceforge.net/release/xsl/current/xhtml/lists.xsl
 
Ideally you would make it so these new templates are only invoked when
some parameter is set or processing instruction is found, in the way the
xslts currently do with the list-presentation processing instructions
(see
http://docbook.sourceforge.net/release/xsl/current/doc/fo/variablelist.a
s.blocks.html etc.), but to start with you might just override the
current default behavior and get that part working. 
 
So it would indeed be an adventure that would involve learning xslt
(which some of us consider lots of fun). As you get into it you could
ask questions here, of course, but if you don't have time for that kind
of fun, your options would be to file a feature request and wait to see
if someone finds time to implement it or to pay a consultant to do it
for you.
 
Yet another option would be to process your existing document with an
xslt to change all the variablelists to itemizedlists of formalparas.
That would be a very simple xslt, but if your documents have DOCTYPEs
and use entities, the entities would be resolved at the end, which
probably wouldn't make you happy. You'd have to process the files to
"hide" the entity references, run the xslt on them, then process them
again to "unhide" the entity references and add the original DOCTYPEs
back on. That bit is a little messy, but I would never consider manually
reformatting a large number of variablelists. You're better off in the
long term investing that time in having someone on your team learn some
scripting skills. You'll find they pay big dividends the next time you
want to munge some xml :-)
 
David
 


________________________________

        From: Laurie Burley [mailto:[email protected]] 
        Sent: Thursday, February 11, 2010 3:43 AM
        To: David Cramer; [email protected]; DeanNelson
        Subject: RE: [docbook-apps] variablelist styles
        
        

        Hi David,

         

        Can you please clarify what you mean by "could adapt the
formalpara/title template and use it in processing your variablelists"

         

        Do you mean that instead of using the 'term' tag, to just leave
it blank and add a 'formalpara' to the listitem? For example:

         

          <variablelist>

            <title>List of Terms</title>

            <varlistentry>

              <term/>

              <listitem>

                <formalpara>

                  <title>Term 1</title>

                  <para>Definition of Term 1</para>

                </formalpara>

              </listitem>

            </varlistentry>

            <varlistentry>

              <term/>

              <listitem>

                <formalpara>

                  <title>Term 2</title>

                  <para>Definition of Term 2</para>

                </formalpara>

              </listitem>

            </varlistentry>

          </variablelist>

         

         or something different?

         

        I have already modified the formalpara to work as required, the
only problem is that we have a HUGE document set that already contains >
400 variablelists throughout. If I have to go and modify them to all use
formalpara, it will take more time than I care to waste.

         

        I agree with Dean, an existing docbook option to do this would
be extremely helpful. Alternatively, an example or outline of the
required XSL changes would be useful.

         

        Kind Regards,

         

        Laurie.

         

        From: David Cramer [mailto:[email protected]] 
        Sent: 10 February 2010 14:39
        To: Laurie Burley; [email protected]
        Subject: RE: [docbook-apps] variablelist styles

         

        Ok, in that case you could adapt the formalpara/title template
and use it in processing your variablelists :-) It's certainly possible
to do that in your customization layer. The fact that the structure of a
varlistentry and a formalpara is slightly different won't stop you and
it would be a reasonble customization to use for learning a little xslt
(i.e. neither impossibly hard nor so simple that you wouldn't learn
anything). 

         

        David

                 

                
________________________________


                From: Laurie Burley [mailto:[email protected]] 
                Sent: Wednesday, February 10, 2010 8:14 AM
                To: David Cramer; [email protected]
                Subject: RE: [docbook-apps] variablelist styles

                Thanks David..

                 

                 I've already looked at that.. I was just hoping that
the variablelist could be modified as the formalpara option would
require us to change all our variablelists to formal paragraphs.

                 

                I suppose we'll need to revisit our use of
variablelists... L

                 

                Regards,

                 

                Laurie.

                 

                From: David Cramer [mailto:[email protected]] 
                Sent: 10 February 2010 14:08
                To: Laurie Burley; [email protected]
                Subject: RE: [docbook-apps] variablelist styles

                 

                I think you really want a list of formalparas but
without bullets.

                 

                <itemizedlist mark="none">

        
<listitem><formalpara><title>Term</title><para>Definition of term
here.</para></formalpara></listitem>

                </itemizedlist>

                 

                Note that you don't need to add a period in the title.
The xsls add it for you. However, if you add a .!? or : the xsls don't
add a period. This behavior is controlled by the xsl params:

                 

                <xsl:param name="runinhead.default.title.end.punct"
select="'.'"/>

                <xsl:param name="runinhead.title.end.punct"
select="'.!?:'"/>

                 

                David

                        
________________________________


                        From: Laurie Burley
[mailto:[email protected]] 
                        Sent: Wednesday, February 10, 2010 5:31 AM
                        To: [email protected]
                        Subject: [docbook-apps] variablelist styles

                        Hi,

                         

                        I've been playing around with the variablelist
styles to try and figure out if there is a way to make the variablelist
term and listitem definition appear on the same line, but as if they run
together.

                         

                        I don't like the default vl.as.list style
because we have several long terms and I don't like the wrap behaviour
of the list-item-label which is independent to the list-item-body wrap
behaviour.

                         

                        Currently I have the following behaviour using
the list style:

                         

                        Term.                    Definition for the term
here.

                        Next Term.         Definition for next term
here.

                        Third Term          Definition for third term
here.

                        with a really 

                        long title.

                         

                        What I would like is:

                         

                        Term.  Definition for the term here.

                        Next Term.  Definition for next term here.

                        Third Term with a really long title.  Definition
for the third term here.

                         

                        I am relatively new to XSL, so there is a lot
about the way things nest that I don't understand yet. What I want may
not be possible because of the listitem element, but I thought it
wouldn't hurt to ask. Has anyone managed to create the behaviour I would
like above?

                         

                        Any suggestions or advice would be really
appreciated.

                         

                        Kind Regards,

                         

                        Laurie.

                        Laurie Burley
                        Sr. Tech Comm Spc.
                        Kofax U.K., Ltd.

                        201 Cambridge Science Park
                        Milton Road, Cambridge
                        CB4 0GZ
                        United Kingdom

                        Tel: +44 (0) 1223 226021
                        [email protected]

                         

                        
________________________________


                        This communication is only for the use of the
intended recipient. It may contain confidential or proprietary
information. If you are not the intended recipient or have received this
communication in error, please notify the sender via phone and destroy
this communication immediately. 

                         

Reply via email to