dita-ot / dita-ot/dita-ot

The content introduced by the coderef tag is not subject to topic-reader processing

Open
#4,575 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
455
Forks
211
Avg merge
1d 11h
Merged PRs (30d)
3

Description

Expected Behavior

The content introduced by the coderef tag was not added with the ITA -ot:x="3" ITA -ot:y="1" attribute during the preprocessing phase, causing me to report an error when converting the document using pdf2

Actual Behavior

001.dita

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_union_01" >
<topic id="topic_union_01_1" >
<title></title>
<body>

</body>
</topic>
<coderef  parse="xml" href="001-2.dita"  />
</topic>


001-2.dita

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic  id="topic-bbbbb">
<title>test</title>
<body>
<p>
<table>
<tgroup cols="8">
<colspec colname="col1" colwidth="0.05*"/>
<colspec colname="col2" colwidth="0.05*"/>
<colspec colname="col3" colwidth="0.09*"/>
<colspec colname="col4" colwidth="0.23*"/>
<colspec colname="col5" colwidth="0.17*"/>
<colspec colname="col6" colwidth="0.13*"/>
<colspec colname="col7" colwidth="0.18*"/>
<colspec colname="col8" colwidth="0.1*"/>
<tbody>
<row valign="middle">
<entry height="30" valign="middle" align="center">type</entry>
<entry valign="middle" align="center">1</entry>
<entry valign="middle" align="center">2</entry>
<entry valign="middle" align="center">3</entry>
<entry valign="middle" align="center">4</entry>
<entry valign="middle" align="center">5</entry>
<entry valign="middle" align="center">6</entry>
<entry valign="middle" align="center">7</entry>
</row>

</tbody>
</tgroup>
</table>
</p>
</body>
</topic>





Possible Solution


Image

The 'topic-reader' step parses the file and generates the attributes dita-ot:x="3" dita-ot:y="1"

The 'preprocess2.topic-fragment' step processes the coderef tag and inserts the content into the destination location

Because the content is not processed by the topic-reader step, the content is missing some attributes

Do you run the topic-reader logic to supplement it while processing?

Steps to Reproduce

  1. Create 001.dita and 001-2.dita files
  2. Run the following commands to process the 001.dita and 001-2.dita files respectively
  3. In the temp directory, view the file changes
    

Image

Copy of the error message, log file or stack trace



Image

https://github.com/kafeim/error-file/blob/main/log.log

Environment

windows 11 java 17.0.7

  • DITA-OT version: 4.2.4
  • Operating system and version: windows
    (Linux, macOS, Windows)
  • How did you run DITA-OT?
    (dita command, Ant, startcmd, oXygen, other editor, CMS, etc.)
./bin/dita -i 001-2.dita 
--format=pdf2 
-o demo/out -d 
--clean.temp no 
-l demo/log.log 
--temp demo/temp  
-Dvalidate=false
  • Transformation type: pdf2
    (HTML5, PDF, custom, etc.)
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the topic-reader and preprocess2.topic-fragment steps, using the 001.dita and 001-2.dita examples and the provided pdf2 command. Compare the temporary files to see where dita-ot:x="3" and dita-ot:y="1" are absent from coderef content; done means the converted output includes the expected attributes and no longer reports the described error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, xml
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.