Re: Possible to customize ditatoPDF based on outputclass?

"[email protected]" <[email protected]> Tue, 21 Jan 2025 11:27:16 -0700
Newsgroups gmane.text.xml.xfc.general
Message-ID <[email protected]>
--===============7853704320046723697==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_0F597F05-2F6E-4D88-B3C0-97CB843F9B63"


--Apple-Mail=_0F597F05-2F6E-4D88-B3C0-97CB843F9B63
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hi guys. One more question. I=E2=80=99d like to run xslutil from the =
command line on MacOS but can=E2=80=99t figure out how to do it.

I=E2=80=99ve read section 2.5 of the documentation, specifically:=20

Linux/Mac example:
/opt/xslutil-6_5_0/bin$ xslutil dbToDocx /tmp/help.xml /tmp/help.docx


I downloaded xslutil_eval-6_5_0.dmg. And with the help you=E2=80=99ve =
already provided I now have everything working exactly as I=E2=80=99d =
like with my dita files, ditatoPDF conversion, and a custom stylesheet =
(file:/Users/danmcintosh/Documents/fo_custom.xsl) using the full =
XSUtility program.

I=E2=80=99m now trying to run xslutil from the command line so that I =
can ultimately run the utility from a shell script to convert numerous =
XML files at once. Ideally, I=E2=80=99d like to use the custom =
stylesheet I=E2=80=99ve created when doing this. But I can=E2=80=99t =
seem to find where MacOS put this directory and executable after =
installing from the dmg file, so I can't execute xslutil from the =
command line in the MacOS Terminal at all.

I guess I=E2=80=99m pretty ignorant about where things go after =
installing from a dmg file. Any help would be appreciated, as this is =
the last step I=E2=80=99m trying to accomplish to get a demo up and =
running.



> On Jan 20, 2025, at 8:37=E2=80=AFAM, Hussein Shafie =
<[email protected]> wrote:
>=20
> On 1/20/25 04:57, [email protected] wrote:
>> I=E2=80=99m currently evaluating the personal edition of XML Editor =
and XSLUtility. Overall, I really enjoy using these products and am =
considering purchasing the xde-usr license and XSLUtility. I really like =
these products and appreciate that I can run them on MacOs (unlike =
something like Madcap Flare or FrameMaker).
>> I have a question regarding the DITA to PDF transformation using the =
ditatoPDF conversion specification (Apache FOP):
>> I have a use case where I currently use the outputclass attribute, =
giving it a value like emphasis01, emphasis02, etc. I can then use this =
class with a CSS selector to style specific elements in the HTML output. =
I can do this just by updating the CSS stylesheet, even without using =
XSLUtility. Ideally, I could also use the outputclass when using the =
ditatoPDF transformation in XSLUtility. But I don=E2=80=99t see an =
attribute set associated with the outputclass attribute. (My current =
workaround is to make use of an unused element type in my XML =
doc=E2=80=94uicontrol=E2=80=94and then I=E2=80=99m doing the custom =
styling in the XSLUtility based on that.)
>=20
> There are indeed no attribute-sets which are associated with the =
outputclass attribute. Note that we don't see how attribute-sets could =
be used for that.
>=20
>=20
>> So is there any way to add an =E2=80=9Coutputclass =3D <value>=E2=80=9D=
 to the XSL customization? That would help tremendously and I could =
simply use the outputclass attribute in the XML Editor to set up a few =
styling things I need in both HTML and PDF outputs.
>> Similarly, it would be nice to have a way to convert a =
=E2=80=9Cboolean=3Dyes" or =E2=80=9Cboolean=3Dno" so that I could =
transform these guys to a =E2=80=9Cgreen checkmark=E2=80=9D or =E2=80=9Cre=
d checkbox=E2=80=9D or some UTF character while doing the conversion.
>> Is it possible to do either of these things with the current version =
of XSLUtility? I might just be missing something. Or would it be =
possible to add something like this to the conversion options?
>=20
> Yes. It's certainly possible to achieve all what you want but you'll =
have to write custom XSLT templates for that.
>=20
> Here's how to proceed:
>=20
> 1) Start XSLUtility and select a DITA document to be converted to PDF. =
Choose the ditaToPDF conversion. See attached "1app.png".
>=20
> 2) Click "Edit" and select the "Transform" tab. See attached =
"2edit_transform.png".
>=20
> 3) Click "Customize" and specify the name of the file which is to =
contain your custom XSLT templates. See attached =
"3customize_fo_xsl.png".
>=20
> Created ".xsl" file is almost empty and looks like this:
> ---
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> <?stylesheet-label ?>
> <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
>                version=3D"2.0">
>=20
>   <xsl:import href=3D"xslutil-config:dita/xsl/fo/fo.xsl"/>
>=20
>   <!-- REDEFINE PARAMETERS AND ATTRIBUTE-SETS HERE -->
>=20
> </xsl:stylesheet>
> ---
>=20
> 4) Once your customization file, e.g. "custom_fo.xsl",  has been =
created, click the "file chooser" icon to select it. See attached =
"4use_custom_fo_xsl.png".
>=20
> 5) Now add XSLT templates to your customization file using a text or =
XML editor.
>=20
> First thing to do is declare the "fo" namespace prefix:
> ---
> <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
>                xmlns:fo=3D"http://www.w3.org/1999/XSL/Format"
>                version=3D"2.0">
> ---
>=20
> Let's suppose we want to give a specific style (dark red, underlined) =
to <i> and <b> elements having @outputclass=3D"emphasis". This may be =
done as follows:
>=20
> ---
>  <xsl:attribute-set name=3D"emphasis_style">
>    <xsl:attribute name=3D"color">maroon</xsl:attribute>
>    <xsl:attribute name=3D"text-decoration">underline</xsl:attribute>
>  </xsl:attribute-set>
>=20
>  <xsl:template match=3D"b[@outputclass=3D'emphasis']">
>    <fo:inline xsl:use-attribute-sets=3D"b emphasis_style">
>      <xsl:call-template name=3D"commonAttributes"/>
>      <xsl:apply-templates/>
>    </fo:inline>
>  </xsl:template>
>=20
>  <xsl:template match=3D"i[@outputclass=3D'emphasis']">
>    <fo:inline xsl:use-attribute-sets=3D"i emphasis_style">
>      <xsl:call-template name=3D"commonAttributes"/>
>      <xsl:apply-templates/>
>    </fo:inline>
>  </xsl:template>
> ---
>=20
> Let's suppose we want to render <boolean state=3D"yes"/> and <boolean =
state=3D"no"/> as OK/Cancel icons. This may be done as follows:
>=20
> ---
>  <xsl:template match=3D"boolean">
>    <fo:external-graphic content-height=3D"16px">
>      <xsl:attribute name=3D"src">
>        <xsl:choose>
>          <xsl:when test=3D"@state eq 'yes'">
>            <xsl:value-of =
select=3D"'url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zP=
SJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzM=
ub3Jn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1saW5lY2FwPSJidXR0IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIiBzdHJva2Utb=
Wl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjA=
iIGZvbnQtZmFtaWx5PSJub25lIiBmb250LXdlaWdodD0ibm9uZSIgZm9udC1zaXplPSJub25lI=
iB0ZXh0LWFuY2hvcj0ibm9uZSIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBub3JtYWwiPgogICA=
gICAgIDxwYXRoIGQ9Ik0zOTIsMjkuNWw5MC41LDkwLjVsLTEzNiwxMzZsMTM2LDEzNmwtOTAuN=
Sw5MC41bC0xMzYsLTEzNmwtMTM2LDEzNmwtOTAuNSwtOTAuNWwxMzYsLTEzNmwtMTM2LC0xMzZ=
sOTAuNSwtOTAuNWwxMzYsMTM2eiIgaWQ9ImN1cnZlMCIvPgogICAgPC9nPgo8L3N2Zz4=3D)'"=
/>
>          </xsl:otherwise>
>        </xsl:choose>
>      </xsl:attribute>
>    </fo:external-graphic>
>  </xsl:template>
> ---
>=20
> Complete, working (see attached "dita-sample_pdf.png"), =
"custom_fo.xsl" attached to this email.
>=20
> Now the question is: how to write these custom XSLT templates? Answer: =
by looking at the corresponding stock templates.
>=20
> You'll find all stock templates in folder =
"XSLUtility_INSTALL_DIR/addon/config/dita/xsl/fo/". For example =
"XSLUtility_INSTALL_DIR/addon/config/dita/xsl/fo/typographic.xsl" =
contains the stock template for element <b>:
>=20
> ---
>  <xsl:attribute-set name=3D"b">
>    <xsl:attribute name=3D"font-weight">bold</xsl:attribute>
>  </xsl:attribute-set>
>=20
>  <xsl:template match=3D"*[contains(@class,' hi-d/b ')]">
>    <fo:inline xsl:use-attribute-sets=3D"b">
>      <xsl:call-template name=3D"commonAttributes"/>
>      <xsl:apply-templates/>
>    </fo:inline>
>  </xsl:template>
> ---
>=20
>=20
> =
<1app.png><2edit_transform.png><3customize_fo_xsl.png><4use_custom_fo_xsl.=
png><custom_fo.xsl><dita_sample_pdf.png>


--Apple-Mail=_0F597F05-2F6E-4D88-B3C0-97CB843F9B63
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><div>Hi guys. =
One more question. I=E2=80=99d like to run xslutil from the command line =
on MacOS but can=E2=80=99t figure out how to do =
it.</div><div><br></div><div><div>I=E2=80=99ve read section 2.5 of the =
documentation, specifically:&nbsp;</div><div><br></div><blockquote =
style=3D"margin: 0px 0px 0px 40px; border: medium; padding: =
0px;"><div><p style=3D"margin: 0px; font-stretch: normal; font-size: =
13px; line-height: normal; font-family: &quot;Helvetica Neue&quot;; =
font-size-adjust: none; font-kerning: auto; font-variant-alternates: =
normal; font-variant-ligatures: normal; font-variant-numeric: normal; =
font-variant-east-asian: normal; font-variant-position: normal; =
font-feature-settings: normal; font-optical-sizing: auto; =
font-variation-settings: normal;">Linux/Mac example:</p></div><div><p =
style=3D"margin: 0px; font-stretch: normal; font-size: 13px; =
line-height: normal; font-family: &quot;Helvetica Neue&quot;; =
font-size-adjust: none; font-kerning: auto; font-variant-alternates: =
normal; font-variant-ligatures: normal; font-variant-numeric: normal; =
font-variant-east-asian: normal; font-variant-position: normal; =
font-feature-settings: normal; font-optical-sizing: auto; =
font-variation-settings: normal;">/opt/xslutil-6_5_0/bin$ xslutil =
dbToDocx /tmp/help.xml =
/tmp/help.docx</p></div><div><br></div></blockquote></div><div><br></div><=
div>I downloaded xslutil_eval-6_5_0.dmg. And with the help you=E2=80=99ve =
already provided I now have everything working exactly as I=E2=80=99d =
like with my dita files, ditatoPDF conversion, and a custom stylesheet =
(file:/Users/danmcintosh/Documents/fo_custom.xsl) using the full =
XSUtility program.</div><div><br></div><div>I=E2=80=99m now trying to =
run xslutil from the command line so that I can ultimately run the =
utility from a shell script to convert numerous XML files at once. =
Ideally, I=E2=80=99d like to use the custom stylesheet I=E2=80=99ve =
created when doing this. But I can=E2=80=99t seem to find where MacOS =
put this directory and executable after installing from the dmg file, so =
I can't execute xslutil from the command line in the MacOS Terminal at =
all.</div><div><br></div><div>I guess I=E2=80=99m pretty ignorant about =
where things go after installing from a dmg file. Any help would be =
appreciated, as this is the last step I=E2=80=99m trying to accomplish =
to get a demo up and =
running.</div><div><br></div><div><br></div><div><br><blockquote =
type=3D"cite"><div>On Jan 20, 2025, at 8:37=E2=80=AFAM, Hussein Shafie =
&lt;[email protected]&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><div>On 1/20/25 04:57, =
[email protected] wrote:<br><blockquote type=3D"cite">I=E2=80=99m =
currently evaluating the personal edition of XML Editor and XSLUtility. =
Overall, I really enjoy using these products and am considering =
purchasing the xde-usr license and XSLUtility. I really like these =
products and appreciate that I can run them on MacOs (unlike something =
like Madcap Flare or FrameMaker).<br>I have a question regarding the =
DITA to PDF transformation using the ditatoPDF conversion specification =
(Apache FOP):<br>I have a use case where I currently use the outputclass =
attribute, giving it a value like emphasis01, emphasis02, etc. I can =
then use this class with a CSS selector to style specific elements in =
the HTML output. I can do this just by updating the CSS stylesheet, even =
without using XSLUtility. Ideally, I could also use the outputclass when =
using the ditatoPDF transformation in XSLUtility. But I don=E2=80=99t =
see an attribute set associated with the outputclass attribute. (My =
current workaround is to make use of an unused element type in my XML =
doc=E2=80=94uicontrol=E2=80=94and then I=E2=80=99m doing the custom =
styling in the XSLUtility based on that.)<br></blockquote><br>There are =
indeed no attribute-sets which are associated with the outputclass =
attribute. Note that we don't see how attribute-sets could be used for =
that.<br><br><br><blockquote type=3D"cite">So is there any way to add an =
=E2=80=9Coutputclass =3D &lt;value&gt;=E2=80=9D to the XSL =
customization? That would help tremendously and I could simply use the =
outputclass attribute in the XML Editor to set up a few styling things I =
need in both HTML and PDF outputs.<br>Similarly, it would be nice to =
have a way to convert a =E2=80=9Cboolean=3Dyes" or =E2=80=9Cboolean=3Dno" =
so that I could transform these guys to a =E2=80=9Cgreen checkmark=E2=80=9D=
 or =E2=80=9Cred checkbox=E2=80=9D or some UTF character while doing the =
conversion.<br>Is it possible to do either of these things with the =
current version of XSLUtility? I might just be missing something. Or =
would it be possible to add something like this to the conversion =
options?<br></blockquote><br>Yes. It's certainly possible to achieve all =
what you want but you'll have to write custom XSLT templates for =
that.<br><br>Here's how to proceed:<br><br>1) Start XSLUtility and =
select a DITA document to be converted to PDF. Choose the ditaToPDF =
conversion. See attached "1app.png".<br><br>2) Click "Edit" and select =
the "Transform" tab. See attached "2edit_transform.png".<br><br>3) Click =
"Customize" and specify the name of the file which is to contain your =
custom XSLT templates. See attached =
"3customize_fo_xsl.png".<br><br>Created ".xsl" file is almost empty and =
looks like this:<br>---<br>&lt;?xml version=3D"1.0" =
encoding=3D"UTF-8"?&gt;<br>&lt;?stylesheet-label =
?&gt;<br>&lt;xsl:stylesheet =
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;version=3D"2.0"&gt;<br><br> &nbsp;&nbsp;&lt;xsl:import =
href=3D"xslutil-config:dita/xsl/fo/fo.xsl"/&gt;<br><br> =
&nbsp;&nbsp;&lt;!-- REDEFINE PARAMETERS AND ATTRIBUTE-SETS HERE =
--&gt;<br><br>&lt;/xsl:stylesheet&gt;<br>---<br><br>4) Once your =
customization file, e.g. "custom_fo.xsl", &nbsp;has been created, click =
the "file chooser" icon to select it. See attached =
"4use_custom_fo_xsl.png".<br><br>5) Now add XSLT templates to your =
customization file using a text or XML editor.<br><br>First thing to do =
is declare the "fo" namespace prefix:<br>---<br>&lt;xsl:stylesheet =
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;xmlns:fo=3D"http://www.w3.org/1999/XSL/Format"<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;version=3D"2.0"&gt;<br>---<br><br>Let's suppose we want =
to give a specific style (dark red, underlined) to &lt;i&gt; and =
&lt;b&gt; elements having @outputclass=3D"emphasis". This may be done as =
follows:<br><br>---<br> &nbsp;&lt;xsl:attribute-set =
name=3D"emphasis_style"&gt;<br> &nbsp;&nbsp;&nbsp;&lt;xsl:attribute =
name=3D"color"&gt;maroon&lt;/xsl:attribute&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;xsl:attribute =
name=3D"text-decoration"&gt;underline&lt;/xsl:attribute&gt;<br> =
&nbsp;&lt;/xsl:attribute-set&gt;<br><br> &nbsp;&lt;xsl:template =
match=3D"b[@outputclass=3D'emphasis']"&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;fo:inline xsl:use-attribute-sets=3D"b =
emphasis_style"&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:call-template =
name=3D"commonAttributes"/&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:apply-templates/&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;/fo:inline&gt;<br> =
&nbsp;&lt;/xsl:template&gt;<br><br> &nbsp;&lt;xsl:template =
match=3D"i[@outputclass=3D'emphasis']"&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;fo:inline xsl:use-attribute-sets=3D"i =
emphasis_style"&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:call-template =
name=3D"commonAttributes"/&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:apply-templates/&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;/fo:inline&gt;<br> =
&nbsp;&lt;/xsl:template&gt;<br>---<br><br>Let's suppose we want to =
render &lt;boolean state=3D"yes"/&gt; and &lt;boolean state=3D"no"/&gt; =
as OK/Cancel icons. This may be done as follows:<br><br>---<br> =
&nbsp;&lt;xsl:template match=3D"boolean"&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;fo:external-graphic content-height=3D"16px"&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:attribute name=3D"src"&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:choose&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:when =
test=3D"@state eq 'yes'"&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:=
value-of =
select=3D"'url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zP=
SJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzM=
ub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgN=
TEyIDUxMiI+CiAgICA8dGl0bGU+Y2hlY2sgaWNvbjwvdGl0bGU+CiAgICA8ZGVzYz5jaGVjayB=
pY29uIGZyb20gdGhlIEljb25FeHBlcmllbmNlLmNvbSBHLUNvbGxlY3Rpb24uIENvcHlyaWdod=
CBieSBJTkNPUlMgR21iSCAod3d3LmluY29ycy5jb20pLjwvZGVzYz4KICAgIDxkZWZzPgogICA=
gICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iNyIgeTE9IjM0LjUiIHgyPSIzODEuNDI3NyIgeTI9I=
jQzNy4zMjE1IiBncmFkaWVudFVuaXRzPSJ1c2Vy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gZm9udC1zaXplPSJub25lI=
iB0ZXh0LWFuY2hvcj0ibm9uZSIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBub3JtYWwiPgogICA=
gICAgIDxwYXRoIGQ9Ik0zOTIsMjkuNWw5MC41LDkwLjVsLTEzNiwxMzZsMTM2LDEzNmwtOTAuN=
Sw5MC41bC0xMzYsLTEzNmwtMTM2LDEzNmwtOTAuNSwtOTAuNWwxMzYsLTEzNmwtMTM2LC0xMzZ=
sOTAuNSwtOTAuNWwxMzYsMTM2eiIgaWQ9ImN1cnZlMCIvPgogICAgPC9nPgo8L3N2Zz4=3D)'"=
/&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:otherwise&g=
t;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:choose&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:attribute&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;/fo:external-graphic&gt;<br> =
&nbsp;&lt;/xsl:template&gt;<br>---<br><br>Complete, working (see =
attached "dita-sample_pdf.png"), "custom_fo.xsl" attached to this =
email.<br><br>Now the question is: how to write these custom XSLT =
templates? Answer: by looking at the corresponding stock =
templates.<br><br>You'll find all stock templates in folder =
"XSLUtility_INSTALL_DIR/addon/config/dita/xsl/fo/". For example =
"XSLUtility_INSTALL_DIR/addon/config/dita/xsl/fo/typographic.xsl" =
contains the stock template for element &lt;b&gt;:<br><br>---<br> =
&nbsp;&lt;xsl:attribute-set name=3D"b"&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;xsl:attribute =
name=3D"font-weight"&gt;bold&lt;/xsl:attribute&gt;<br> =
&nbsp;&lt;/xsl:attribute-set&gt;<br><br> &nbsp;&lt;xsl:template =
match=3D"*[contains(@class,' hi-d/b ')]"&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;fo:inline xsl:use-attribute-sets=3D"b"&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:call-template =
name=3D"commonAttributes"/&gt;<br> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:apply-templates/&gt;<br> =
&nbsp;&nbsp;&nbsp;&lt;/fo:inline&gt;<br> =
&nbsp;&lt;/xsl:template&gt;<br>---<br><br><br><span =
id=3D"cid:13555DF9-BF92-4A4B-B3E1-992D6193C224">&lt;1app.png&gt;</span><sp=
an =
id=3D"cid:805F1F77-A535-483B-A169-4361ED71181F">&lt;2edit_transform.png&gt=
;</span><span =
id=3D"cid:C416A82F-6194-40D9-82FE-523A22D7296B">&lt;3customize_fo_xsl.png&=
gt;</span><span =
id=3D"cid:4B3D688C-E0E1-484F-BA63-0D8036B4FAC7">&lt;4use_custom_fo_xsl.png=
&gt;</span><span =
id=3D"cid:6217DFE2-7452-4FBC-A22D-53066A0AA7DB">&lt;custom_fo.xsl&gt;</spa=
n><span =
id=3D"cid:E196CC36-85B7-447E-AF41-9F0AC1A499EC">&lt;dita_sample_pdf.png&gt=
;</span></div></div></blockquote></div><br></body></html>=

--Apple-Mail=_0F597F05-2F6E-4D88-B3C0-97CB843F9B63--

--===============7853704320046723697==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--
XMLmind FO Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xfc-support

--===============7853704320046723697==--