All Downloads are FREE. Search and download functionalities are using the official Maven repository.

docbook.template.titlepage.xsl Maven / Gradle / Ivy

There is a newer version: 2.4
Show newest version









  

  
  




  
  
  
    Titlepage Template Stylesheet Reference
    
      $Id: titlepage.xsl 9940 2014-09-06 16:06:50Z bobstayton $
    
  
  
    Introduction
    This is technical reference documentation for the
      “titlepage” templates in the DocBook XSL Stylesheets.
    This is not intended to be user documentation.  It is
      provided for developers writing customization layers for the
      stylesheets.
  








  

Obtain namespace prefix for an element identified by a string containing qualified name

This template interprets a string containing a qualified name of an element
and returns the namespace prefix, if any.
Element name could be an XPath expression starting with the element name; this
template will first determine if the occurrence of a colon is preceded by a valid
NCName, assuming only ASCII characters.


  

  
  
  
    
  

  

Obtain URI for an element identified by a string containing qualified name

This template interprets a string containing a qualified name of an element
and returns the namespace URI for that element, looking for namespace prefixes
starting from a reference node.


  

  
  
  
  
  
    
      
    
  

  
    
      
    
    
      
        WARNING: Namespace '
        
        ' not defined for t:element="
        
        "; if this is intentional (output has is not in a namespace), add 
        t:missing-namespace-ok="yes" attribute to t:templates to suppress this warning.
      
    
  



Output the wrapper element


This template locates the namespace for the defined wrapper element
and output it within that namespace. The content of the element is passed
via the content argument.
The attribute sets to use for the wrapper element and the element to
copy non-template attributes from are also passed as arguments.




  
  
  
  
  
  
    
      
      
    
  
  
  
    
      
    
    
      
        
      
    
    
  



Construct a stylesheet for the templates provided


The t:templates element is the root of a
set of templates. This template creates an appropriate
xsl:stylesheet for the templates.

If the t:templates element has a
base-stylesheet attribute, an
xsl:import statement is constructed for it.

If the t:templates element has a
copy-namespaces attribute, it is interpreted as a
space-separated list of namespace prefixes to be copied from the template
to the resulting stylesheet. Default namespace is always copied.




  

    
      
        
      
    

    
      
    

    
    
    
      
        
      
    

    1.0

    
      
        exsl d
        exsl
      
    

    


    
       This stylesheet was created by 
      template/titlepage.xsl
    

    
      


      
        
          
        
      
    

    

    


  





Copy xsl: elements straight through


This template simply copies the xsl: elements
straight through into the result tree.




  





Create the templates necessary to construct a title page


The t:titlepage element creates a set of
templates for processing the titlepage for an element. The
root of this template set is the template named
wrapper.titlepage. That is the
template that should be called to generate the title page.


The t:titlepage element has three attributes:


element
The name of the source document element for which
these templates apply. In other words, to make a title page for the
article element, set the
element attribute to
article. This attribute is required.


wrapper
The entire title page can be wrapped with an element.
This attribute identifies that element.


class
If the class attribute
is set, a class attribute with this
value will be added to the wrapper element that surrounds the entire
title page.





Any other attributes are copied through literally to the
wrapper element.

The content of a t:titlepage is one or
more t:titlepage-content,
t:titlepage-separator, and
t:titlepage-before elements.

Each of these elements may be provided for the recto
and verso sides of the title page.





  
  

  
  


  
    
      
      .titlepage
    
    
  
    
      
        
    
        
          recto.content
          
      
          
            
              
              .titlepage.before.recto
            
          
          
      
          
            
              
              .titlepage.recto
            
          
          
    
        
        
    
        
          recto.elements.count
          
      
          
            
        
            
              function-available('exsl:node-set')
              
                count(exsl:node-set($recto.content)/*)
              
            
            
        
            
              contains(system-property('xsl:vendor'), 'Apache Software Foundation')
              
          
              Xalan quirk
              
                count(exsl:node-set($recto.content)/*)
              
            
            
        
            
              1
            
            
      
          
          
    
        
        
    
        
          (normalize-space($recto.content) != '') or ($recto.elements.count > 0)
          
      
          
            
            
              
                $recto.content
              
            
          
          
    
        
        
    
        
          verso.content
          
      
          
            
              
              .titlepage.before.verso
            
          
          
      
          
            
              
              .titlepage.verso
            
          
          
    
        
        
    
        
          verso.elements.count
          
      
          
            
        
            
              function-available('exsl:node-set')
              
                count(exsl:node-set($verso.content)/*)
              
            
            
        
            
              contains(system-property('xsl:vendor'), 'Apache Software Foundation')
              
          
              Xalan quirk
              
                count(exsl:node-set($verso.content)/*)
              
            
            
        
            
              1
            
            
      
          
          
    
        
        
    
        
          (normalize-space($verso.content) != '') or ($verso.elements.count > 0)
          
      
          
            
            
              
                $verso.content
              
            
          
          
    
        
        
    
        
          
            
            .titlepage.separator
          
        
        
  
      
    
    

  

  

  
    
    


    
      *
      
        
        .titlepage.recto.mode
      
      
  
       if an element isn't found in this mode, 
      
  
       try the generic titlepage.mode 
      
  
      
        .
        titlepage.mode
      
      

    

    
    


    
      *
      
        
        .titlepage.verso.mode
      
      
  
       if an element isn't found in this mode, 
      
  
       try the generic titlepage.mode 
      
  
      
        .
        titlepage.mode
      
      

    
  

  
  
  
  
    
    
      


      
        
          
          
        
        
          
          .titlepage.
          
          .auto.mode
        
        

        
          
            
            .titlepage.
            
            .style
          
          
            


            
              
                
                  
                    
                  
                  
                    
                      

                      
                        
                          
                        
                        
                          
                        
                      
                    
                  
                  

                
              
              
                
                  .
                  
                    
                    .titlepage.
                    
                    .mode
                  
                
              
            

            

          
        
        

      
    
  





Create templates for the content of one side of a title page


The title page content, that is, the elements from the source
document that are rendered on the title page, can be controlled independently
for the recto and verso sides of the title page.

The t:titlepage-content element has two attributes:


side
Identifies the side of the page to which this title
page content applies. The
side attribute is required and
must be set to either 
recto or
verso. In addition, you must specify
exactly one t:titlepage-content for each side
within each t:titlepage.


order
Indicates how the order of the elements presented on
the title page is determined. If the
order is
document, the elements are presented
in document order. Otherwise (if the
order is
stylesheet), the elements are presented
in the order that they appear in the template (and consequently in
the stylesheet).





The content of a t:titlepage-content element is
a list of element names. These names should be unqualified.  They identify
the elements in the source document that should appear on the title page.


Each element may have a single attribute:
predicate. The value of this
attribute is used as a predicate for the expression that matches
the element on which it occurs.

In other words, to put only the first three authors on the
recto-side of a title
page, you could specify:


    
    
    
  
]]>


Usually, the elements so named are empty. But it is possible to
make one level of selection within them. Suppose that you want to
process authorgroup elements on the title page, but
you want to select only proper authors, editors, or corporate authors,
not collaborators or other credited authors.

In that case, you can put a t:or group inside
the authorgroup element:


    
    
      
        
        
        
      
    
    
  
]]>


This will have the effect of automatically generating a template
for processing authorgroups in the title page mode,
selecting only the specified children. If you need more complex processing,
you'll have to construct the templates by hand.





  
    
      
        
      
      
        
          Illegal value specified for @t:side 
          on t:titlepage-content: 
          
        
      
      
        
          The @t:side attribute is required on 
          t:titlepage-content.
        
      
    
  

  
    
    .titlepage.
    
    .auto.mode
  

  


  
    
      
      .titlepage.
      
    

    
      
      
        
          
            
              
            
            
              
            
          
        
      

      
      
        
      
    
    

  
  





Create templates for the separator


The title page is separated from the content which follows it by
the markup specified in the t:titlepage-separator
element.




  


  
    
      
      .titlepage.separator
    

    
    

  





Create templates for what precedes a title page


Each side of the title page is preceded by the markup specified
in the t:titlepage-before element for that
side.




  


  
    
      
      .titlepage.before.
      
    

    
    

  





Copy elements


This template simply copies the elements that it applies to
straight through into the result tree.




  
    
      
	
	
      
    
    
      
	
	
      
    
  





Copy attributes


This template simply copies the attributes that it applies to
straight through into the result tree.




  
    
      
	
      
    
    
      
	
      
    
  





Create rules to process titlepage elements in document order


This template is called to process all of the children of the
t:titlepage-content element. It creates the hairy
select expression necessary to process each of those elements in
the title page.

Note that this template automatically handles the case where
some DocBook elements, like title and subtitle, can occur both inside
the *info elements where metadata is usually stored and outside.


It also automatically calculates the name for the *info container
and handles elements that have historically had containers with different
names.





  
    
    info
  

  
    
      
        artheader
      
      
        blockinfo
      
      
      
      
      
      
      
      
      
      
      docinfo
    
  

  
    
      
        
      
      
        recto
      
    
  

  
    
    .titlepage.
    
    .auto.mode
  

  
    |
  

  
  
  /
  
  
  
    
  

  
    |
    
    
    /
    
    
    
      
    
  

  
  |
  
  info
  /
  
  
  
    
  

  
    |
    
    
    
      
    
  





Create rules to process titlepage elements in stylesheet order


This template is called to process all of the children of the
t:titlepage-content element. It creates the set
of xsl:apply-templates elements necessary
process each of those elements in the title page.

Note that this template automatically handles the case where
some DocBook elements, like title and subtitle, can occur both inside
the *info elements where metadata is usually stored and outside.


It also automatically calculates the name for the *info container
and handles elements that have historically had containers with different
names.





  
    
    info
  

  
    
      
        artheader
      
      
        blockinfo
      
      
      
      
      
      
      
      
      
      
      docinfo
    
  

  
    
      
        
      
      recto
    
  

  
    
    .titlepage.
    
    .auto.mode
  

  
  

  
    
      
        
          
            
              
              .titlepage.
              
              .style
            
            
              

              
                
                  
                
                
                  
                    

                    
                      
                        
                      
                      
                        
                      
                    
                  
                
                

              
            
          
        
        
          
            Force can only be used with named-templates.
          
        
      
    
    

      
        
          
          
            
    
            
              
                
                
                /
                
                
              
              
      
              
                
                  
                
                
                  
                  
                  /
                  
                  
                  
                    
                  
                
              
              
    
            

            
              
    
              
                
                  
                  
                  /
                  
                  
                
                
      
                
                  
                    
                  
                  
                    
                    
                    /
                    
                    
                    
                      
                    
                  
                
                
    
              
            

            
            
    
            
              
                
                
                /
                
                
              
              
      
              
                
                  
                
                
                  
                  
                  /
                  
                  
                  
                    
                  
                
              
              
    
            

            
    
            
              
                
                
              
              
      
              
                
                  
                
                
                  
                  
                  
                    
                  
                
              
              
    
            
            
  
          
          

        
        

          
          
            
              
            
            
              
              
              /
              
              
              
                
              
            
          

          
          
            
  
            
              
                
              
              
                
                
                /
                
                
                
                  
                
              
            
          

          
          
  
          
            
              
            
            
              
              
              /
              
              
              
                
              
            
          
        
      
    
  





Create templates for special rules


This template is called to process all of the descendants of the
t:titlepage-content element that require special
processing. At present, that's just t:or elements.





  
    
      
        
      
      recto
    
  

  
    
    .titlepage.
    
    .auto.mode
  

  
    
      
    
    
      
      


        
          
            
          
          
            
          
          
          

        
      
    
  





Create template for individual special rules


This template is called to process the children of special
template elements.





  
    
      
        
      
      recto
    
  

  
    
    .titlepage.
    
    .auto.mode
  

  
    
      
    
    
      
    
  





Process the t:or special rule


This template processes t:or.




  
    
      
        
      
      recto
    
  

  
    
    .titlepage.
    
    .auto.mode
  

  
  
  
    
      
    
    
      
    
  





Process the t:or special rule in
titlepage.subrules mode


The titlepage.subrules mode doesn't apply to t:or, so just
reprocess this node in the normal mode.




  





Construct the "or-list" used in the select attribute for
special rules.


Walk through each of the children of t:or, producing the
text of the select attribute.




  
  
  
  

  
    
      
    
    
      
        
        
        
        
          
          |
          
        
      
    
  





  

  
    
      
        
          title
        
        
          
        
      
    
    
      
        
          
            ancestor-or-self::
            
            
          
          
        
        
          
        
      
    
    
      
    
  







© 2015 - 2025 Weber Informatics LLC | Privacy Policy