Skip to content

Conversation

@jhradilek
Copy link
Owner

@jhradilek jhradilek commented Nov 10, 2025

DITA 1.3 does not allow examples to appear in sections, but reference topics allow alternating between examples and sections. This pull request ensures that when examples are present, the output reference topic correctly alternates between them and sections.

Example DITA input

  <body>
    <p>First paragraph.</p>
    <example>
      <p>First example.</p>
    </example>
    <p>Second paragraph.</p>
    <section>
      <title>First section</title>
    </section>
    <section>
      <title>Second section</title>
    </section>
    <example>
      <p>Second example.</p>
    </example>
  </body>

Example DITA output

  <refbody>
    <section>
      <p>First paragraph.</p>
    </section>
    <example>
      <p>First example.</p>
    </example>
    <section>
      <p>Second paragraph.</p>
    </section>
    <section>
      <title>First section</title>
    </section>
    <section>
      <title>Second section</title>
    </section>
    <example>
      <p>Second example.</p>
    </example>
  </refbody>

Implementation checklist

  • The code changes come with the corresponding test cases
  • The code changes pass all tests (run python3 -m unittest in the project directory)
  • The code changes come with appropriate documentation

@jhradilek jhradilek self-assigned this Nov 10, 2025
@jhradilek jhradilek added the bug Something isn't working label Nov 10, 2025
@jhradilek
Copy link
Owner Author

@kleinffm FYI, this is fixes the issue you ran into when converting reference topics with examples in them.

@jhradilek jhradilek merged commit bb9e8e2 into main Nov 10, 2025
5 checks passed
@jhradilek jhradilek deleted the fix-reference-xslt branch November 10, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants