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

[DOTJ013E] Fail to include mp4 video in a topic with Dita OT 3.0 #2947

Open
Veknelyon opened this Issue May 2, 2018 · 11 comments

Comments

Projects
None yet
6 participants
@Veknelyon
Copy link

Veknelyon commented May 2, 2018

I have the following file organisation:

test_video/
|-- topic1.xml
|-- small.mp4

When processing topic1.xml:

<?xml version="1.0" encoding="UTF-8"?><!--Arbortext, Inc., 1988-2015, v.4002--><?Pub UDT instructions _comment FontColor="red"?><?Pub Inc?>
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="topic1" rev="A.2" translate="no" xml:lang="en-US" xtrc="topic1">
  <title>Video test in topic</title>
  <shortdesc/>
  <prolog>
    <critdates>
      <created date="2017-08-24 10:24:01.0"/>
      <revised modified="2017-10-18 15:12:48.0"/>
    </critdates>
    <metadata>
      <prodinfo>
        <prodname/>
        <vrmlist>
          <vrm release="Draft" version="A.3"/>
        </vrmlist>
      </prodinfo>
    </metadata>
  </prolog>
  <conbody>
    <p>
      Test video small.mp4
      <object data="small.mp4" width="640" />
      <?Pub Caret -1?>
    </p>
  </conbody>
</concept>

I have the following error:

$ ./DITA-OT-3.0/bin/dita -i test_video/topic1.xml -f xhtml -o test_video/out/
Unable to locate tools.jar. Expected to find it in ***/openjdk/8/lib/tools.jar
[gen-list] Warning at xsl:stylesheet on line 6 column 31 of utils.xsl:
[gen-list]   Stylesheet module classpath:///utils.xsl is included or imported more than once. This is
[gen-list]   permitted, but may lead to errors or unexpected behavior
[gen-list] Type error at char 4 in xsl:apply-templates/@select on line 18 column 43 of html2dita.xsl:
[gen-list]   XTTE0570: An empty sequence is not allowed as the value of variable $dita
[gen-list] [DOTJ013E][ERROR] Failed to parse the referenced file 'file:/fluid-topics/tmp/test_video/small.mp4'.: An empty sequence is not allowed as the value of variable $dita

This problem does not appear with Dita OT 2.5:

$ ./DITA-OT-2.5/bin/dita -i test_video/topic1.xml -f xhtml -o out/
Unable to locate tools.jar. Expected to find it in ***/openjdk/8/lib/tools.jar

Environment

  • DITA-OT version: 3.0.3
  • Operating system and version:
    Linux
  • How did you run DITA-OT?
    dita command
  • Transformation type:
    XHTML / HTML5
@jelovirt

This comment has been minimized.

Copy link
Member

jelovirt commented May 29, 2018

The error seems to be thrown from html2dita.xsl. Could you run the conversion with verbose logging, with -v argument, and send the log for that. DITA-OT doesn't have a stylesheet html2dita.xsl so this is probably from some custom plugin.

@mblawrence

This comment has been minimized.

Copy link

mblawrence commented May 30, 2018

I'm not the reporter, but an interested 3rd party running into the same issue.

I have attached 3 files:

  • docs.ditamap
  • test.dita
  • dita.out

test.dita has an object that is referencing a youtube video:

<?xml version="1.0" encoding="UTF-8"?><?path2rootmap-uri ./?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="test-case"><title>Test Case</title><body><object data="https://www.youtube.com/embed/MW8M3tr1XXo" outputclass="iframe">
</object></body></topic>(master 9889a99*) [out] cat test.dita | xmllint --format -
<?xml version="1.0" encoding="UTF-8"?>
<?path2rootmap-uri ./?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="test-case">
  <title>Test Case</title>
  <body>
    <object data="https://www.youtube.com/embed/MW8M3tr1XXo" outputclass="iframe">
</object>
  </body>
</topic>

dita.out is the output I get containing the DOTJ013E message.

Command line: dita-ot-3.0.4/bin/dita -v -i docs.ditamap -o out -f dita

@raducoravu

This comment has been minimized.

Copy link
Member

raducoravu commented May 30, 2018

👍 I have the same problem as the first poster (direct reference to an mp4 video), the method "org.dita.dost.reader.GenListModuleReader.parseObject(Attributes)" seems to be properly called but the generated ".job.xml" contains no reference to the "mp4" video. Thus the clip gets processed as a "dita" topic and it also is not copied to the output folder.
Sample project:
clipReferencedInTopic.zip

@raducoravu

This comment has been minimized.

Copy link
Member

raducoravu commented May 30, 2018

Somehow if in the "GenListModuleReader.parseObject(Attributes)" the video reference is added with format=image the ".job.xml" starts having proper references to it and it gets copied to the output folder

        nonConrefCopytoTargets.add(new Reference(filename, ATTR_FORMAT_VALUE_IMAGE));
@Veknelyon

This comment has been minimized.

Copy link
Author

Veknelyon commented Jun 4, 2018

I directly download Dita-OT from the download page so I don't think the problem come from a plugin.
Here are my data (with the video) and the corresponding verbose output (I reproduced with Dita-OT 3.0.4):

Let me know if you manage to reproduce.

@lionelmoi

This comment has been minimized.

Copy link
Contributor

lionelmoi commented Jul 24, 2018

The error seems to be thrown from html2dita.xsl. Could you run the conversion with verbose logging, with -v argument, and send the log for that. DITA-OT doesn't have a stylesheet html2dita.xsl so this is probably from some custom plugin.

I reproduced the error with 3.1.1 html2dita.xsl does exist, in the org.lwdita plugin which is packaged in the plugins directory of the official dita-ot archive.

The issue disappears after removing the plugin.

@kodango

This comment has been minimized.

Copy link

kodango commented Jan 4, 2019

I also encountered this problem, if the dita file contains a video link. My dita-ot version is 3.0.4, also it exist in 3.2.0.

@kodango

This comment has been minimized.

Copy link

kodango commented Jan 7, 2019

Somehow if in the "GenListModuleReader.parseObject(Attributes)" the video reference is added with format=image the ".job.xml" starts having proper references to it and it gets copied to the output folder

        nonConrefCopytoTargets.add(new Reference(filename, ATTR_FORMAT_VALUE_IMAGE));

Hi, raducoravu, does you find any solution to fix this problem ?

@raducoravu

This comment has been minimized.

Copy link
Member

raducoravu commented Jan 7, 2019

@dangoakachan I agree, what I did on my side was to make changes to the "org.dita.dost.reader.GenListModuleReader.parseObject(Attributes)" to only copy resources which are not on the web, something like:

    if("http".equals(filename.getScheme()) || "https".equals(filename.getScheme())){
    	//OXYGEN PATCH FOR EXM-40072
    	//External reference.
    } else {
    	//OXYGEN PATCH Try to mark it as an image, it gets copied to the output folder....
    	//https://github.com/dita-ot/dita-ot/issues/2947
  //        	nonConrefCopytoTargets.add(new Reference(filename, ATTR_FORMAT_VALUE_HTML));
    	nonConrefCopytoTargets.add(new Reference(filename, ATTR_FORMAT_VALUE_IMAGE));
    }

then created a separate JAR library with the modified compiled version of GenListModuleReader and add a new DITA OT plugin which contributes this JAR library so that the changes I made are used instead of the original class from the "dost.jar".

@kodango

This comment has been minimized.

Copy link

kodango commented Jan 7, 2019

@dangoakachan I agree, what I did on my side was to make changes to the "org.dita.dost.reader.GenListModuleReader.parseObject(Attributes)" to only copy resources which are not on the web, something like:

    if("http".equals(filename.getScheme()) || "https".equals(filename.getScheme())){
    	//OXYGEN PATCH FOR EXM-40072
    	//External reference.
    } else {
    	//OXYGEN PATCH Try to mark it as an image, it gets copied to the output folder....
    	//https://github.com/dita-ot/dita-ot/issues/2947
  //        	nonConrefCopytoTargets.add(new Reference(filename, ATTR_FORMAT_VALUE_HTML));
    	nonConrefCopytoTargets.add(new Reference(filename, ATTR_FORMAT_VALUE_IMAGE));
    }

then created a separate JAR library with the modified compiled version of GenListModuleReader and add a new DITA OT plugin which contributes this JAR library so that the changes I made are used instead of the original class from the "dost.jar".

Thanks for your quick reply.

I try to add the patch code and replace the original jar, then run the code no exception throws, but when open the pdf file, the video is still not show. It's the same if the object data attribute set to a local video path.

@raducoravu

This comment has been minimized.

Copy link
Member

raducoravu commented Mar 15, 2019

+1 Somebody else reported the same problem on the Oxygen forum:
https://www.oxygenxml.com/forum/viewtopic.php?f=20&t=19579&p=52848#p52848\

Our end user also reports that removing the "org.lwdita" also somehow solves the problem. Looking at this plugin, all ANT build targets that it contributes have individual specific names, so the only way in which it would interfere is by contributing this parser for the "html" format:

 <parser format="html" class="com.elovirta.dita.html.HtmlReader"/>
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.