Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xref with format pdf, txt, .. do not work properly in DITA OT 3.x #2899

Closed
ritti opened this issue Feb 20, 2018 · 10 comments

Comments

Projects
3 participants
@ritti
Copy link

commented Feb 20, 2018

Expected Behavior

I have a dita Topic that contains file references to different formats (txt, pdf, docx, zip).
The files are located in the same Directory as the dita Topic file.
When transforming this Topic to xthml I would expect that the files are also copied to the Output Directory.
According to the spec at least pdf and txt should be supported:
https://docs.oasis-open.org/dita/dita/v1.3/errata01/os/complete/part1-base/langRef/attributes/theformatattribute.html

<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
  <topic id="id_40a72787efc94c2a8bb6e60f8cac2b2c">
	<title>Test</title>
	<shortdesc>Test format attribute with zip, pdf, ...</shortdesc>
	<body>
		<p>
			<ul>
				<li><xref href="Test.pdf" format="pdf">pdf file</xref></li>
				<li><xref href="Test.zip" format="zip">zip file</xref></li>
				<li><xref href="Test.docx" format="docx">docx file</xref></li>
				<li><xref href="Test.txt" format="txt">txt file</xref></li>
			</ul>
		</p>
	</body>
  </topic>
</dita>

Actual Behavior

With DITA OT 2.4 all files are copied to the Output Directory and the links work correctly.
With DITA OT 3.x the files are NOT copied to the Output Directory. Consequently the links do not work.

Possible Solution

Steps to Reproduce

Copy of the error message, log file or stack trace

Environment

  • DITA-OT version: dita-ot 3.0.2
  • Operating system and version:
    Windows
  • How did you run DITA-OT?
    (dita command, Ant, startcmd, oXygen, other editor, CMS, etc.)
//Xhtml with dita-ot 3.0.2
"C:\dita-ot-3.0.2\bin\dita" --input=Test.ditamap --output=out\xhtml302 --format=xhtml --temp=temp302 --logfile=log302.xml --clean.temp=no --verbose

//Xhtml with dita-ot 2.4
"C:\\dita-ot-2.4\bin\dita" --input=Test.ditamap --output=out\xhtml24 --format=xhtml --temp=temp24 --logfile=log24.xml --clean.temp=no --verbose
  • Transformation type:
    xhtml
@raducoravu

This comment has been minimized.

Copy link
Member

commented Mar 21, 2018

Tested the problem with DITA OT 3.0.4, it's still there. In this case the ".job.xml" has no reference to the "Test.pdf" whatsoever.

@raducoravu

This comment has been minimized.

Copy link
Member

commented May 30, 2018

Similar problem when in the DITA Map I have a reference to the PDF (tested using DITA OT 3.0.4):

    <topicref navtitle="PDF TITLE" href="tasks/flowers.pdf" format="pdf"/>

The .job.xml has a reference to it:

    <file src="file:/D:/projects/eXml/test/dita/transform/tasks/flowers.pdf"
        uri="tasks/flowers.pdf" path="tasks\flowers.pdf"
        result="file:/D:/projects/eXml/test/dita/transform/tasks/flowers.pdf" format="pdf"/>

but the "copy-files" target only copies images and html files by calling the "copy-image" and "copy-html" targets.
What it should actually do would be to maybe merge the "copy-html" and "copy-images" to a target called "copy-non-dita" and copy all non-DITA resources in the same way to the output folder.

@raducoravu

This comment has been minimized.

Copy link
Member

commented Jun 13, 2018

Problem persists in DITA OT 3.1. Referenced non-DITA and non-HTML files are no longer copied to the output folder.

@raducoravu

This comment has been minimized.

Copy link
Member

commented Dec 6, 2018

Same problem with DITA OT 3.2. In "dita-ot-3.2\plugins\org.dita.base\build_preprocess_template.xml" the "copy-files" target depends on "copy-image" and "copy-html", how about if it would depend on a "copy-non-dita" target which copies all resources in the job.xml which do not have DITA or DITAMap format.
Otherwise we would need to add extra targets like "copy-pdf", "copy-zip" and so on.

@raducoravu

This comment has been minimized.

Copy link
Member

commented Dec 6, 2018

@jelovirt what's your opinion on this?

@jelovirt

This comment has been minimized.

Copy link
Member

commented Dec 6, 2018

The most simple solution would probably be to copy all resources that are not dita, ditamap, or ditaval.

@raducoravu

This comment has been minimized.

Copy link
Member

commented Dec 6, 2018

@jelovirt but probably for this the "org.dita.dost.ant.types.JobSourceSet" would need to be modified to be able to specify a negative format filter, in this case "not(dita)".

@jelovirt

This comment has been minimized.

Copy link
Member

commented Dec 6, 2018

Then it would need to be not(dita | ditamap | ditaval), i.e. a custom language. Need to think what would be an alternative way to solve that.

@raducoravu

This comment has been minimized.

Copy link
Member

commented Dec 20, 2018

Something like:

     <ditafileset format="dita" exclude="true"/>

which would mean copy all resources excluding the "dita" ones.
And afterwards we would join the "copy-image" and "copy-html" targets to a single "copy-other" target.

@jelovirt

This comment has been minimized.

Copy link
Member

commented Jan 10, 2019

I think the most Ant-like option would be to add support for

<ditafileset>
  <exclude format="dita"/>
  <exclude format="ditamap"/>
  <exclude format="ditaval"/>
</ditafileset>

@jelovirt jelovirt added this to To do in 3.3 via automation Jan 30, 2019

@jelovirt jelovirt added this to the 3.3 milestone Jan 30, 2019

@jelovirt jelovirt moved this from To do to Done in 3.3 Jan 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.