Re: Attribute conditioning

Jirka Kosek <[email protected]> Mon, 12 Sep 2022 15:21:20 +0200
Newsgroups gmane.text.docbook.misc
Message-ID <[email protected]>
On 09.09.2022 14:54, Matteo Regazzo wrote:
> <table frame=”all”>   if the output format is HTML
> 
> <table frame=”none”> if the output format is PDF

You would usually use profiling for this, but for handling attribute 
values it is not very practical as profiling condition is attached to a 
whole element not only to single attribute.

> Does it exists something similar to the following example, in the XLST world?
> 
> <table>
>    <add-attribute-to-parent name=”frame” value=”all” outputformat=”HTML”/>
>    <add-attribute-to-parent name=”frame” value=”none” outputformat=”PDF”/>
>     …
>     …
> </table>

It would be better to use processing instruction for this, otherwise 
your document will not be valid DocBook, i.e.

<table>
    <?attr name="frame" value="all" outputformat="HTML"?>
    <?attr name="frame" value="none" outputformat="PDF"/>

With such markup it would be quite easy to modify profiling step in the 
stylesheets to add desired attributes to a parent element.

				Jirka


-- 
------------------------------------------------------------------
   Jirka Kosek      e-mail: [email protected]      http://xmlguru.cz
------------------------------------------------------------------
      Professional XML and Web consulting and training services
DocBook/DITA customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
     Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------
OpenPGP_signature (application/pgp-signature, 203 B) - not displayed