| Newsgroups |
gmane.text.xml.xfc.general |
| Message-ID |
<[email protected]> |
--===============8699188147823166718==
Content-Type: multipart/alternative;
boundary="Apple-Mail=_9258BECC-2EBA-4714-A975-9DFC2AFF9935"
--Apple-Mail=_9258BECC-2EBA-4714-A975-9DFC2AFF9935
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
Guys I=E2=80=99m so sorry! I figured it all out and I have everything =
working from the command line now.
Sorry to have troubled you with this. I should have tried to figure it =
out for another 15-30 minutes and I would have not sent all these =
emails.
Thank you so much. Je suis desol=C3=A9!
Dan
> On Jan 21, 2025, at 12:49=E2=80=AFPM, [email protected] wrote:
>=20
>=20
> Update:=20
>=20
> I=E2=80=99ve found xslutil in =
/applications/xslutility.app/contents/resources/xslutil/bin
>=20
> However, I=E2=80=99m still not able to execute it. When I enter =
=E2=80=98xslutil=E2=80=99 from the above directory, the shell says =
command not found:
>=20
> zsh: command not found: xslutil
>=20
> I=E2=80=99m sure I=E2=80=99m missing something simple, but I don=E2=80=99=
t understand why I can=E2=80=99t launch xslutil from the command line.
>=20
> Thanks
>=20
> Dan
>=20
>=20
>> On Jan 21, 2025, at 11:27=E2=80=AFAM, [email protected] wrote:
>>=20
>> 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.
>>=20
>> I=E2=80=99ve read section 2.5 of the documentation, specifically:=20
>>=20
>> Linux/Mac example:
>> /opt/xslutil-6_5_0/bin$ xslutil dbToDocx /tmp/help.xml /tmp/help.docx
>>=20
>>=20
>> 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.
>>=20
>> 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.
>>=20
>> 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.
>>=20
>>=20
>>=20
>>> 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=
ub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgN=
TEyIDUxMiI+CiAgICA8dGl0bGU+Y2hlY2sgaWNvbjwvdGl0bGU+CiAgICA8ZGVzYz5jaGVjayB=
pY29uIGZyb20gdGhlIEljb25FeHBlcmllbmNlLmNvbSBHLUNvbGxlY3Rpb24uIENvcHlyaWdod=
CBieSBJTkNPUlMgR21iSCAod3d3LmluY29ycy5jb20pLjwvZGVzYz4KICAgIDxkZWZzPgogICA=
gICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iNyIgeTE9IjM0LjUiIHgyPSIzODEuNDI3NyIgeTI9I=
jQzNy4zMjE1IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImNvbG9yLTEiPgo=
gICAgICAgICAgICA8c3RvcCBvZmZ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MzYsMTM2eiIgaWQ9ImN1cnZlMCIvPgogICAgPC9nPgo8L3N2Zz4=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>
>>=20
>=20
--Apple-Mail=_9258BECC-2EBA-4714-A975-9DFC2AFF9935
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;">Guys I=E2=80=99m=
so sorry! I figured it all out and I have everything working from the =
command line now.<div><br></div><div>Sorry to have troubled you with =
this. I should have tried to figure it out for another 15-30 minutes and =
I would have not sent all these emails.</div><div><br></div><div>Thank =
you so much. Je suis =
desol=C3=A9!</div><div><br></div><div>Dan</div><div><br></div><div><br></d=
iv><div><br id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On Jan 21, 2025, at 12:49=E2=80=AFPM, =
[email protected] wrote:</div><br =
class=3D"Apple-interchange-newline"><div><meta http-equiv=3D"content-type"=
content=3D"text/html; charset=3Dutf-8"><div style=3D"overflow-wrap: =
break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;"><div><br></div><div>Update: </div><div><br></div>=
<div>I=E2=80=99ve found xslutil in <span style=3D"color: rgb(255, =
255, 255); font-family: Menlo; font-size: 11px; background-color: =
rgb(34, 79, =
188);">/applications/xslutility.app/contents/resources/xslutil/bin</span><=
/div><div><br></div><div>However, I=E2=80=99m still not able to execute =
it. When I enter =E2=80=98xslutil=E2=80=99 from the above directory, the =
shell says command not found:</div><div><br></div><div><div =
style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; =
font-stretch: normal; font-size: 11px; line-height: normal; font-family: =
Menlo; 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; color: =
rgb(255, 255, 255); background-color: rgb(34, 79, 188);"><span =
style=3D"font-variant-ligatures: no-common-ligatures">zsh: command not =
found: xslutil</span></div></div><div><br></div><div>I=E2=80=99m sure =
I=E2=80=99m missing something simple, but I don=E2=80=99t understand why =
I can=E2=80=99t launch xslutil from the command =
line.</div><div><br></div><div>Thanks</div><div><br></div><div>Dan</div><b=
r id=3D"lineBreakAtBeginningOfMessage"><div><br><blockquote =
type=3D"cite"><div>On Jan 21, 2025, at 11:27=E2=80=AFAM, =
[email protected] wrote:</div><br =
class=3D"Apple-interchange-newline"><div><meta http-equiv=3D"content-type"=
content=3D"text/html; charset=3Dutf-8"><div 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: </div><div><br></div><blockquote style=3D"margin: 0px =
0px 0px 40px; border: medium; padding: 0px;"><div><div style=3D"margin: =
0px; font-stretch: normal; font-size: 13px; line-height: normal; =
font-family: "Helvetica Neue"; 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:</div></div><div><div style=3D"margin: 0px; font-stretch: =
normal; font-size: 13px; line-height: normal; font-family: =
"Helvetica Neue"; 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</div></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=99v=
e 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 =
<[email protected]> 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 <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.<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><?xml version=3D"1.0" =
encoding=3D"UTF-8"?><br><?stylesheet-label =
?><br><xsl:stylesheet =
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"<br> =
&n=
bsp; version=3D"2.0"><br><br> <xsl:import =
href=3D"xslutil-config:dita/xsl/fo/fo.xsl"/><br><br> =
<!-- REDEFINE PARAMETERS AND ATTRIBUTE-SETS HERE =
--><br><br></xsl:stylesheet><br>---<br><br>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".<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><xsl:stylesheet =
xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"<br> =
&n=
bsp; xmlns:fo=3D"http://www.w3.org/1999/XSL/Format"<br> =
&n=
bsp; version=3D"2.0"><br>---<br><br>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:<br><br>---<br> <xsl:attribute-set =
name=3D"emphasis_style"><br> <xsl:attribute =
name=3D"color">maroon</xsl:attribute><br> =
<xsl:attribute =
name=3D"text-decoration">underline</xsl:attribute><br> =
</xsl:attribute-set><br><br> <xsl:template =
match=3D"b[@outputclass=3D'emphasis']"><br> =
<fo:inline xsl:use-attribute-sets=3D"b =
emphasis_style"><br> =
<xsl:call-template =
name=3D"commonAttributes"/><br> =
<xsl:apply-templates/><br> =
</fo:inline><br> =
</xsl:template><br><br> <xsl:template =
match=3D"i[@outputclass=3D'emphasis']"><br> =
<fo:inline xsl:use-attribute-sets=3D"i =
emphasis_style"><br> =
<xsl:call-template =
name=3D"commonAttributes"/><br> =
<xsl:apply-templates/><br> =
</fo:inline><br> =
</xsl:template><br>---<br><br>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:<br><br>---<br> =
<xsl:template match=3D"boolean"><br> =
<fo:external-graphic content-height=3D"16px"><br> =
<xsl:attribute name=3D"src"><br> =
<xsl:choose><br> =
<xsl:when =
test=3D"@state eq 'yes'"><br> =
<xsl:=
value-of =
select=3D"'url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zP=
SJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzM=
ub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgN=
TEyIDUxMiI+CiAgICA8dGl0bGU+Y2hlY2sgaWNvbjwvdGl0bGU+CiAgICA8ZGVzYz5jaGVjayB=
pY29uIGZyb20gdGhlIEljb25FeHBlcmllbmNlLmNvbSBHLUNvbGxlY3Rpb24uIENvcHlyaWdod=
CBieSBJTkNPUlMgR21iSCAod3d3LmluY29ycy5jb20pLjwvZGVzYz4KICAgIDxkZWZzPgogICA=
gICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iNyIgeTE9IjM0LjUiIHgyPSIzODEuNDI3NyIgeTI9I=
jQzNy4zMjE1IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImNvbG9yLTEiPgo=
gICAgICAgICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM3N2RhMjYiLz4KICAgI=
CAgICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjNWJhNjFlIi8+CiAgICAgICA=
gPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxnIGZpbGw9InVybCgjY29sb3ItM=
SkiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSJub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kaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImNvbG9yLTE=
iPgogICAgICAgICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNlZjVjNTEiLz4KI=
CAgICAgICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjYzQzMTI2Ii8+CiAgICA=
gICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxnIGZpbGw9InVybCgjY29sb=
3ItMSkiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjE=
iIHN0cm9rZS1saW5lY2FwPSJidXR0IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIiBzdHJva2Utb=
Wl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjA=
iIGZvbnQtZmFtaWx5PSJub25lIiBmb250LXdlaWdodD0ibm9uZSIgZm9udC1zaXplPSJub25lI=
iB0ZXh0LWFuY2hvcj0ibm9uZSIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBub3JtYWwiPgogICA=
gICAgIDxwYXRoIGQ9Ik0zOTIsMjkuNWw5MC41LDkwLjVsLTEzNiwxMzZsMTM2LDEzNmwtOTAuN=
Sw5MC41bC0xMzYsLTEzNmwtMTM2LDEzNmwtOTAuNSwtOTAuNWwxMzYsLTEzNmwtMTM2LC0xMzZ=
sOTAuNSwtOTAuNWwxMzYsMTM2eiIgaWQ9ImN1cnZlMCIvPgogICAgPC9nPgo8L3N2Zz4=3D)'"=
/><br> =
</xsl:otherwise&g=
t;<br> </xsl:choose><br> =
</xsl:attribute><br> =
</fo:external-graphic><br> =
</xsl:template><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 <b>:<br><br>---<br> =
<xsl:attribute-set name=3D"b"><br> =
<xsl:attribute =
name=3D"font-weight">bold</xsl:attribute><br> =
</xsl:attribute-set><br><br> <xsl:template =
match=3D"*[contains(@class,' hi-d/b ')]"><br> =
<fo:inline xsl:use-attribute-sets=3D"b"><br> =
<xsl:call-template =
name=3D"commonAttributes"/><br> =
<xsl:apply-templates/><br> =
</fo:inline><br> =
</xsl:template><br>---<br><br><br><span =
id=3D"cid:13555DF9-BF92-4A4B-B3E1-992D6193C224"><1app.png></span><sp=
an =
id=3D"cid:805F1F77-A535-483B-A169-4361ED71181F"><2edit_transform.png>=
;</span><span =
id=3D"cid:C416A82F-6194-40D9-82FE-523A22D7296B"><3customize_fo_xsl.png&=
gt;</span><span =
id=3D"cid:4B3D688C-E0E1-484F-BA63-0D8036B4FAC7"><4use_custom_fo_xsl.png=
></span><span =
id=3D"cid:6217DFE2-7452-4FBC-A22D-53066A0AA7DB"><custom_fo.xsl></spa=
n><span =
id=3D"cid:E196CC36-85B7-447E-AF41-9F0AC1A499EC"><dita_sample_pdf.png>=
;</span></div></div></blockquote></div><br></div></div></blockquote></div>=
<br></div></div></blockquote></div><br></div></body></html>=
--Apple-Mail=_9258BECC-2EBA-4714-A975-9DFC2AFF9935--
--===============8699188147823166718==
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
--===============8699188147823166718==--