Thanks Hussein :)
-----Original Message-----
From: Hussein Shafie [mailto:[email protected]]
Sent: 07 February 2014 19:15
To: Mike Dodds
Cc: [email protected]
Subject: Re: [ditac] Attachments in Webhelp?
On 02/07/2014 04:27 PM, Mike Dodds wrote:
>
> I hope you can help. I'm stuck with how I can have a link to an
> attachment from a topic and have it convert correctly to webhelp using
> ditac.
>
> The attachments are xml files but with a suffix .moform. I've put
> these files in a folder called attachments and in the topic I have Xrefs like:
>
> <xref href="../attachments/Dates.moform">Dates.moform</xref>
>
> When I run the conversion I end up with HTML like:
>
> <a class="xref"
> href="file:/C:/mosaic/documentation_DITA/Product/mosaic/attachments/Da
> tes.moform">Dates.moform
>
> I've tried adding -r attachments and -r ..\attachments to the command
> line but the attachments folder contents are not copied across and the
> html href is the same.
>
> ditac -format webhelp -resources attachments -images images -p
> xsl-resources-directory resources -t
> "C:\mosaic\documentation_DITA\Common\webhelp_custom.xsl"
> C:\mosaic\documentation_DITA\out\ConfiguringYourmosaicSite\_.html
> C:\mosaic\documentation_DITA\Product\mosaic\bm_configyoursite.ditamap
>
> I suspect I'm going about this the wrong way.
>
> I haven't tried, but it might work if I put the attachments in the
> images folder and change the xrefs in the topics. But that seems like
> a hack.
>
> Can you suggest how I should go about this?
>
I do this in my own DITA documents:
1) In the following snippet the attachment is Embed1.java. Notice the <xref>
element:
---
<p>The full source code of the <apiname>Embed1</apiname> sample is found in
<xref format="java" href="embed/Embed1.java"
scope="external"><filepath>Embed1.java</filepath></xref>.</p>
---
a) I've specified scope="external" to instruct ditac not to process the
"embed/Embed1.java" relative URI. ***scope="external" is critical in the case
of attachments.***
b) I've specified format="java", just in case.
c) In my makefile, after running ditac, I copy the embed/ directory to the
directory containing the Web Help pages:
---
cp_samples:
cp -r embed ./../doc/manual/webhelp
---
What's above is an actual example. See:
http://www.xmlmind.com/ditac/_distrib/doc/manual/webhelp/embed1.html
--> Advanced usage:
In some cases, you need to generate several formats, each format stored in its
own directory. When this is the case, you may prefer not to copy the
attachments several times, that is, one copy per output directory.
XSLT stylesheet parameter "external-resource-base" allows to solve this
problem. See
http://www.xmlmind.com/ditac/_distrib/doc/manual/webhelp/xsltParams.html#xsltParams__external-resource-base
++++ Message Scanning REF:565-AVS2-1391800495 ++++
--
XMLmind DITA Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/ditac-support