How to Disable Auto-Generated unique_ Prefix IDs in Oxygen When Generating PDFs with CSS?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 3
- Joined: Thu May 15, 2025 4:00 am
How to Disable Auto-Generated unique_ Prefix IDs in Oxygen When Generating PDFs with CSS?
When using Oxygen XML Editor to generate PDFs via DITA-OT with CSS customization, elements in the document (e.g., images) are automatically assigned IDs with a unique_ prefix. For example, in my DITA file, I have an image defined as:
However, in the generated HTML and PDF output, the ID becomes:
I notice that Oxygen/DITA-OT adds a unique_ prefix along with chapter or context information (e.g., unique_8_Connect_42_) to the original ID. I want to preserve the original ID (i.e., EZ60wm06130003) without this auto-generated prefix.
Questions:
How can I configure Oxygen or DITA-OT (via CSS, XSLT, or other settings) to prevent the generation of unique_ prefix IDs?
Are there specific parameters, plugins, or customizations that can achieve this?
Environment Details:
Tool: Oxygen XML Editor 27.1
Any suggestions or solutions would be greatly appreciated!
Code: Select all
<image href="EZ60wm06130003.png" id="EZ60wm06130003"/>
Code: Select all
<img class="- topic/image image"
dita-ot:image-width="633"
dita-ot:image-height="497"
href="EZ60wm06130003.png"
id="unique_8_Connect_42_EZ60wm06130003"
nd:nd-id="EZ60wm06130003"
placement="inline"
src="EZ60wm06130003.png" />
Questions:
How can I configure Oxygen or DITA-OT (via CSS, XSLT, or other settings) to prevent the generation of unique_ prefix IDs?
Are there specific parameters, plugins, or customizations that can achieve this?
Environment Details:
Tool: Oxygen XML Editor 27.1
Any suggestions or solutions would be greatly appreciated!
-
- Posts: 677
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to Disable Auto-Generated unique_ Prefix IDs in Oxygen When Generating PDFs with CSS?
Post by julien_lacour »
Hello,
By default, DITA-OT generates prefix in front of IDs to make sure the ID is unique withing the merged file.
Why do you want to remove this prefix? What are you trying to achieve?
Regards,
Julien
By default, DITA-OT generates prefix in front of IDs to make sure the ID is unique withing the merged file.
Why do you want to remove this prefix? What are you trying to achieve?
Regards,
Julien
-
- Posts: 3
- Joined: Thu May 15, 2025 4:00 am
Re: How to Disable Auto-Generated unique_ Prefix IDs in Oxygen When Generating PDFs with CSS?
I am using Oxygen XML Editor with DITA-OT (based on HTML5 & CSS) to generate PDFs and want to display the image ID as a label below each image. In DITA Map HTML5 output, setting args.artlbl=yes achieves this, but the DITA Map PDF - based on HTML5 & CSS transformation does not support this parameter.julien_lacour wrote: ↑Thu May 15, 2025 10:35 am Hello,
By default, DITA-OT generates prefix in front of IDs to make sure the ID is unique withing the merged file.
Why do you want to remove this prefix? What are you trying to achieve?
Regards,
Julien
To address this, I implemented a CSS solution to display the image ID below the image, as shown below:

Code: Select all
*[class~="topic/image"] {
border: 1px solid #000000;
position: relative;
}
*[class~="topic/image"]::after {
width: 100%;
text-align: right;
margin-bottom: -15px;
display: block;
content: "[" attr(id) "]";
font-size: 0.8em;
color: #000000;
}
Original DITA file: <image href="EZ60wm06130003.png" id="EZ60wm06130003"/>
PDF output ID: unique_5_Connect_42_EZ60wm06130003
1. How can I modify the CSS or DITA-OT configuration to display only the original ID (e.g., EZ60wm06130003) in the label, without the unique_ prefix and contextual information?
2. Is there a way to enable functionality similar to args.artlbl=yes in the PDF output, or an alternative parameter to natively display image IDs?
Any suggestions or solutions would be greatly appreciated!
You do not have the required permissions to view the files attached to this post.
-
- Posts: 677
- Joined: Wed Oct 16, 2019 3:47 pm
Re: How to Disable Auto-Generated unique_ Prefix IDs in Oxygen When Generating PDFs with CSS?
Post by julien_lacour »
Hello,
The original ID is still present in the HTML structure expect it is in the @nd:nd-id attribute, you can fetch it by using the following CSS rule:
I also added [nd|nd-id] in the selector so you wont get warnings on images without ID.
Regards,
Julien
The original ID is still present in the HTML structure expect it is in the @nd:nd-id attribute, you can fetch it by using the following CSS rule:
Code: Select all
@namespace nd url("http://www.oxygenxml.com/css2fo/named-destinations");
*[class~="topic/image"][nd|nd-id]::after {
width: 100%;
text-align: right;
margin-bottom: -15px;
display: block;
content: "[" attr(nd|nd-id) "]";
font-size: 0.8em;
color: #000000;
}
Regards,
Julien
-
- Posts: 3
- Joined: Thu May 15, 2025 4:00 am
Re: How to Disable Auto-Generated unique_ Prefix IDs in Oxygen When Generating PDFs with CSS?
Hi Julien,julien_lacour wrote: ↑Thu May 15, 2025 12:37 pm Hello,
The original ID is still present in the HTML structure expect it is in the @nd:nd-id attribute, you can fetch it by using the following CSS rule:I also added [nd|nd-id] in the selector so you wont get warnings on images without ID.Code: Select all
@namespace nd url("http://www.oxygenxml.com/css2fo/named-destinations"); *[class~="topic/image"][nd|nd-id]::after { width: 100%; text-align: right; margin-bottom: -15px; display: block; content: "[" attr(nd|nd-id) "]"; font-size: 0.8em; color: #000000; }
Regards,
Julien
Thank you so much for your detailed response and the solution! It works perfectly, and I really appreciate your help in resolving this issue.
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service