dita-ot / dita-ot/org.dita.normalize

ID handling for conrefered structures

Open
#5 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
XSLT
Stars
6
Forks
3
PR merge metrics
No merged PRs in 30d

Description

How this plugin handles IDs in conrefered contend depends on the nesting context and can result in output files with duplicate IDs:

- If a conrefered element contains an ID the plugin ignores this for the output element.
Source: ` --> `
Output: ``

- If a conrefered element contains other elements with IDs the plugin generates new IDs for these elements in the corresponding output elements.
Source: ` --> `
Output: ``
But it generates for each conref target only one publication wide ID.
If a conref is used several times within a topic (e. g. product name variables) we get duplicate IDs in the output.
- If an element with conkeyref attribute on top level contains a ID there are two possible outputs:
1. If the conrefered element contains another conkeyref the ID of this target will be set as output ID all other IDs (top-level and all lower conreference levels) are ignored.
Source: ` --> --> `
Output: Output ID from conref 2 `id=“DEF”`
2. If the conrefered element is not a conreference element by itself the top-level ID is set as output ID
Source: ` --> --> `
Output: Output ID from conref 1 `id=“ABC”`

("top-level" means the conreference cascade chain starting point)
("low-level" means the last conrefered target in chain finaly rendered)

I am not shure about the intended handling but first of all it would be good to prevent duplicate ID generation within a topic. Is it possible to generate new IDs for each use case of a conref target or to set a suffix?
Otherwise maybe it would be possible to controll ID generation of nested elements using something like `-dita-use-conref-target`.

Additionally I would like to get the original id values rendered to the output files instead of new generated.

In my opinion the described cases 1. and 2. should grab IDs from the same level: "ABC" (top level) or "DEF" (second level).

Testing Files:
[ID-handling-normalizeDITA.zip](https://github.com/dita-ot/org.dita.normalize/files/627156/ID-handling-normalizeDITA.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.