This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DB XSL: Best way to control the formatting ofelements?


On Tue, Dec 17, 2002 at 01:56:45PM +0000, Marc Palmer wrote:
> 
> Hi,
> 
> What is the suggested/best way to change the output of specific docbook 
> elements without necessarily applying that change to all instances of 
> that element?

That depends on several factors, such as whether a match
attribute can distinguish the instances, or whether they
are processed in different stylesheet modes.
 
> Take for instance an <address> - at the top of my document I'd like it 
> right-aligned under the logo, but addresses later in the document should 
> probably use the default formatting.
> 
> In my titlepage.xml I have added <address fo:text-align="right"/> which 
> works well, but I fear that later addresses that are immediate children of 
> the root node will also be affected  probably not an issue, but this does 
> not "feel" right.

I presume you meant titlepage.templates.xml, and that you
regenerated the titlepage.templates.xsl file from it.
If you look in there, you'll see that
the titlepages are all handled in specific stylesheet modes,
so those settings won't affect address elements processed without
that mode.  Other address elements not on the titlepage 
won't be affected.
 
> Is there some way to apply formatting such as this to specific nodes, 
> perhaps using their id attribute? i.e. a dirty Xpath expression to use in 
> select= in the titlepage.xml?

If you want to get really specific, you can use the role
attribute to select particular instances and apply styles
based on the role value.

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]