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

Using "onlytopic.in.map" gives errors, reads directory #2759

Closed
robander opened this Issue Aug 1, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@robander
Member

robander commented Aug 1, 2017

Expected Behavior

I have a map, which references a single topic, which references another topic with conref.

In the file that is the target of the conref, I have several cross references (marked with scope="peer"), more conref references (to the same file but using strange syntax to leave the file and return: conref="../buildfiles/conref_api_overview.dita##conref_api_overview/test"), and related links (also peer).

When I build this map using default options, the log is clean. I'd expect the same behavior when running with onlytopic.in.map=true, which is our local default so that we don't generate extra files.

Actual Behavior

When I build with onlytopic.in.map=true (our local default), I get a bunch of errors. 1) I get errors about "ignoring copy-to" (this is incorrect, copy-to is not used; these are just peer HTML files or peer DITA topics). 2) I get Content is not allowed in prolog when a directory name is treated as a file and read by debug-filter, by topicpull, and more.

debug-filter:
   [filter] Using Xerces grammar pool for DTD and schema caching.
   [filter] Ignoring a copy-to file file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/ssl.dita
   [filter] Processing file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap to file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/temp/debug.ditamap
   [filter] Ignoring a copy-to file file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/3.html
   [filter] Ignoring a copy-to file file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/1.html
   [filter] Processing file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/ to file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/temp/com.ibm.abcd.install.doc
   [filter] Content is not allowed in prolog.
   [filter] Ignoring a copy-to file file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/2.html
   [filter] Processing file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita to file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/temp/buildfiles/conref_api_overview.dita
   [filter] Processing file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita to file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/temp/com.ibm.abcd.install.doc/debug_install.dita
   [filter] C:\Users\IBM_ADMIN\github\robander\dita-ot\src\main\test\gary\temp\com.ibm.abcd.install.doc\debug_install.dita (The system cannot find the path specified.)
   [filter] Ignoring a copy-to file file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.dita
   [filter] Ignoring a copy-to file file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.4.doc/store
   [filter] Ignoring a copy-to file file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.5.doc/5.html

Possible Solution

I think the .job.xml file is off but I haven't managed to track down why. This accounts for several errors later in the log. For example, it includes a directory, even though all of my references are to files:

<file 
  src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/" 
  uri="com.ibm.abcd.install.doc/" 
  path="com.ibm.abcd.install.doc" 
  result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/" 
  format="dita" resource-only="true"></file>

.job.xml also includes all of the peer files (HTML and DITA), without any indication that they are peer, or non-DITA.

Steps to Reproduce

I've been building debug.ditamap from my test directory with:
call ..\bin\dita -i debug.ditamap -f html5 -Donlytopic.in.map=true -l logclean.log -v -temp temp -Dclean.temp=no

Copy of the error message, log file or stack trace

Full log is in the attached zip.

Environment

  • DITA-OT version: 2.5.1
  • Operating system and version: Windows
  • How did you run DITA-OT? dita command
  • Transformation type: HTML5 or PDF
    onlytopic.zip

@robander robander added bug P1 labels Aug 1, 2017

@robander

This comment has been minimized.

Show comment
Hide comment
@robander

robander Aug 2, 2017

Member

Update ...

When running these attached samples with default options or with onlytopic.in.map=false, the .job.xml file has 4 entries in the <files> section:

<files>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" uri="buildfiles/conref_api_overview.dita" path="buildfiles\conref_api_overview.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" format="dita" has-conref="true" resource-only="true" has-link="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" uri="com.ibm.abcd.install.doc/debug_install.dita" path="com.ibm.abcd.install.doc\debug_install.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" format="dita" has-conref="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" uri="debug.ditamap" path="debug.ditamap" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" format="ditamap"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" uri="com.ibm.abcd.2.doc/test.png" path="com.ibm.abcd.2.doc\test.png" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" format="image"></file>
</files>

When running with onlytopic.in.map=true, it has 12 entries (the same 4 plus peer HTML and DITA files, and a directory name):

<files>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/ssl.dita" uri="com.ibm.1.doc/ssl.dita" path="com.ibm.1.doc\ssl.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/ssl.dita" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" uri="debug.ditamap" path="debug.ditamap" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" format="ditamap"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" uri="com.ibm.abcd.2.doc/test.png" path="com.ibm.abcd.2.doc\test.png" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" format="image" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/3.html" uri="com.ibm.2.doc/3.html" path="com.ibm.2.doc\3.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/3.html" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/1.html" uri="com.ibm.1.doc/1.html" path="com.ibm.1.doc\1.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/1.html" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/" uri="com.ibm.abcd.install.doc/" path="com.ibm.abcd.install.doc" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/" format="dita" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/2.html" uri="com.ibm.2.doc/2.html" path="com.ibm.2.doc\2.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/2.html" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" uri="buildfiles/conref_api_overview.dita" path="buildfiles\conref_api_overview.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" format="dita" has-conref="true" resource-only="true" has-link="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" uri="com.ibm.abcd.install.doc/debug_install.dita" path="com.ibm.abcd.install.doc\debug_install.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" format="dita" has-conref="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.dita" uri="com.ibm.abcd.2.doc/test.dita" path="com.ibm.abcd.2.doc\test.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.dita" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.4.doc/store" uri="com.ibm.4.doc/store" path="com.ibm.4.doc\store" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.4.doc/store" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.5.doc/5.html" uri="com.ibm.5.doc/5.html" path="com.ibm.5.doc\5.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.5.doc/5.html" resource-only="true"></file>
</files>

These non-topicref references are added (without @format and other important items) because of this line added in 2.5: https://github.com/dita-ot/dita-ot/pull/2694/files#diff-39468ef209a4c3f878b5f77121eaf3e4R724

Member

robander commented Aug 2, 2017

Update ...

When running these attached samples with default options or with onlytopic.in.map=false, the .job.xml file has 4 entries in the <files> section:

<files>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" uri="buildfiles/conref_api_overview.dita" path="buildfiles\conref_api_overview.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" format="dita" has-conref="true" resource-only="true" has-link="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" uri="com.ibm.abcd.install.doc/debug_install.dita" path="com.ibm.abcd.install.doc\debug_install.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" format="dita" has-conref="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" uri="debug.ditamap" path="debug.ditamap" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" format="ditamap"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" uri="com.ibm.abcd.2.doc/test.png" path="com.ibm.abcd.2.doc\test.png" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" format="image"></file>
</files>

When running with onlytopic.in.map=true, it has 12 entries (the same 4 plus peer HTML and DITA files, and a directory name):

<files>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/ssl.dita" uri="com.ibm.1.doc/ssl.dita" path="com.ibm.1.doc\ssl.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/ssl.dita" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" uri="debug.ditamap" path="debug.ditamap" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/debug.ditamap" format="ditamap"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" uri="com.ibm.abcd.2.doc/test.png" path="com.ibm.abcd.2.doc\test.png" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.png" format="image" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/3.html" uri="com.ibm.2.doc/3.html" path="com.ibm.2.doc\3.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/3.html" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/1.html" uri="com.ibm.1.doc/1.html" path="com.ibm.1.doc\1.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.1.doc/1.html" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/" uri="com.ibm.abcd.install.doc/" path="com.ibm.abcd.install.doc" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/" format="dita" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/2.html" uri="com.ibm.2.doc/2.html" path="com.ibm.2.doc\2.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.2.doc/2.html" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" uri="buildfiles/conref_api_overview.dita" path="buildfiles\conref_api_overview.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/buildfiles/conref_api_overview.dita" format="dita" has-conref="true" resource-only="true" has-link="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" uri="com.ibm.abcd.install.doc/debug_install.dita" path="com.ibm.abcd.install.doc\debug_install.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.install.doc/debug_install.dita" format="dita" has-conref="true" target="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.dita" uri="com.ibm.abcd.2.doc/test.dita" path="com.ibm.abcd.2.doc\test.dita" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.abcd.2.doc/test.dita" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.4.doc/store" uri="com.ibm.4.doc/store" path="com.ibm.4.doc\store" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.4.doc/store" resource-only="true"></file>
<file src="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.5.doc/5.html" uri="com.ibm.5.doc/5.html" path="com.ibm.5.doc\5.html" result="file:/C:/Users/IBM_ADMIN/github/robander/dita-ot/src/main/test/gary/com.ibm.5.doc/5.html" resource-only="true"></file>
</files>

These non-topicref references are added (without @format and other important items) because of this line added in 2.5: https://github.com/dita-ot/dita-ot/pull/2694/files#diff-39468ef209a4c3f878b5f77121eaf3e4R724

@robander

This comment has been minimized.

Show comment
Hide comment
@robander

robander Aug 2, 2017

Member

Trying out a fix here -- just avoids adding items to "non-topicref resource only" if they are marked peer. Currently we only skip that if they are external: https://github.com/robander/dita-ot/tree/hotfix/onlytopic

Member

robander commented Aug 2, 2017

Trying out a fix here -- just avoids adding items to "non-topicref resource only" if they are marked peer. Currently we only skip that if they are external: https://github.com/robander/dita-ot/tree/hotfix/onlytopic

jelovirt added a commit that referenced this issue Aug 23, 2017

Merge pull request #2761 from robander/hotfix/onlytopic
Do not add peer references to resource-only collection #2759
@jelovirt

This comment has been minimized.

Show comment
Hide comment
@jelovirt

jelovirt Aug 25, 2017

Member

@robander does #2761 fix this?

Member

jelovirt commented Aug 25, 2017

@robander does #2761 fix this?

infotexture added a commit to dita-ot/docs that referenced this issue Aug 30, 2017

Add info on dita-ot/dita-ot#2759 to 2.5.3 RN
Changes implemented in dita-ot/dita-ot#2761

Signed-off-by: Roger Sheen <roger@infotexture.net>

infotexture added a commit to dita-ot/docs that referenced this issue Aug 31, 2017

Merge branch 'hotfix/2.5.3' into develop
* hotfix/2.5.3:
  Implement review feedback on 2.5.3 Release Notes
  Update HTML5 processing description
  Remove obsolete references to Eclipse Map transform
  Add info on dita-ot/dita-ot#2769 to 2.5.3 RN
  Add info on dita-ot/dita-ot#2768 to 2.5.3 RN
  Add info on dita-ot/dita-ot#2759 to 2.5.3 RN
  Update 2.5.3 Release Notes stub with latest issues
  Clarify 'generate.copy.outer' options
  Improve generate.copy.outer docs with explicit description of output files
  Remove redundant default from 'onlytopic.in.map'
  Add PR 2761 to 2.5.3 Release Notes stub
  Prepare 2.5.3 Release Notes stub
  Bump 'maintenance-version' key to “2.5.3”
  Use latest DITA-OT version (2.5.2) for CI builds
  Link to 2.5.2 docs milestone from Release Notes

infotexture added a commit to dita-ot/docs that referenced this issue Aug 31, 2017

Merge branch 'hotfix/2.5.3'
* hotfix/2.5.3:
  Implement review feedback on 2.5.3 Release Notes
  Update HTML5 processing description
  Remove obsolete references to Eclipse Map transform
  Add info on dita-ot/dita-ot#2769 to 2.5.3 RN
  Add info on dita-ot/dita-ot#2768 to 2.5.3 RN
  Add info on dita-ot/dita-ot#2759 to 2.5.3 RN
  Update 2.5.3 Release Notes stub with latest issues
  Clarify 'generate.copy.outer' options
  Improve generate.copy.outer docs with explicit description of output files
  Remove redundant default from 'onlytopic.in.map'
  Add PR 2761 to 2.5.3 Release Notes stub
  Prepare 2.5.3 Release Notes stub
  Bump 'maintenance-version' key to “2.5.3”
  Use latest DITA-OT version (2.5.2) for CI builds
  Link to 2.5.2 docs milestone from Release Notes

@robander robander added this to the 2.5.3 milestone Sep 12, 2017

@robander

This comment has been minimized.

Show comment
Hide comment
@robander

robander Sep 12, 2017

Member

Missed that query 18 days ago - yes, this should be closed now.

Member

robander commented Sep 12, 2017

Missed that query 18 days ago - yes, this should be closed now.

@robander robander closed this Sep 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment