Skip to content

ID handling for conrefered structures #5

@SanFanDocu

Description

@SanFanDocu

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: <conref> --> <ph id=”ABC”>
    Output: <ph>

  • If a conrefered element contains other elements with IDs the plugin generates new IDs for these elements in the corresponding output elements.
    Source: <conref> --> <ph id=”ABC”><ph id=”DEF”>
    Output: <ph><ph id=”djpigfv”>
    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: <conref1 id=”ABC”> --> <conref2 id=”DEF”> --> <conref3 id=”GHI”>
    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: <conref1 id=”ABC”> --> <ph id="DEF"><conref2 id=”GHI”> --> <conref3 id=”JKL”>
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions