Alt text and KeyRefs
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 63
- Joined: Tue Mar 14, 2017 12:36 am
Alt text and KeyRefs
Hello:
I have my images defined as key refs so I can swap them out. I'm wondering if there's a way to define/tie the Alt text to the image key ref, or maybe the image file, so that when I swap the image out, the alt text matches the image that's used.
For example, if I have an image key ref for "new" and in one instance this is a plus sign and in another it's a sheet of paper, my alt text might reflect one or the other but not both.
Help.
Thanks,
I have my images defined as key refs so I can swap them out. I'm wondering if there's a way to define/tie the Alt text to the image key ref, or maybe the image file, so that when I swap the image out, the alt text matches the image that's used.
For example, if I have an image key ref for "new" and in one instance this is a plus sign and in another it's a sheet of paper, my alt text might reflect one or the other but not both.
Help.
Thanks,
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Alt text and KeyRefs
Hi Stacey,
I concur that would be quite nice if it would be possible. Unfortunately I do not think it is. If you want you can register and ask around on the Yahoo Groups DITA Users List.
Here's one possible workaround, imagine a single topic (which is referenced in the main DITA Map with a keydef:
so it does not appear directly in the published output). That single topic contains a lot of images defined inside like:
From any other topic when you want to insert an image you insert a conkeyref to the image ID defined in this particular topic:
so if you want to switch you just change the image ID part to point to some other image.
Regards,
Radu
I concur that would be quite nice if it would be possible. Unfortunately I do not think it is. If you want you can register and ask around on the Yahoo Groups DITA Users List.
Here's one possible workaround, imagine a single topic (which is referenced in the main DITA Map with a keydef:
Code: Select all
<keydef href="imagesRepository.dita" keys="imagesKey"/>
Code: Select all
...............
<image id="imageID" href="../images/Chrysanthemums.jpg">
<alt>Alternate text</alt>
</image>
...........
Code: Select all
<image conkeyref="imagesKey/imageID"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 63
- Joined: Tue Mar 14, 2017 12:36 am
Re: Alt text and KeyRefs
Okay, Radu. Thanks. 
I had actually been doing that, but because of the way we're building things, it seems like image keys are preferred. Although I guess I could use image keys in the reuse content... except, I think that puts me back to my original spot, where changing out the image leaves the wrong alt text behind.
Luckily we're currently exporting largely to PDF, so it may not issue for a little while.
(Maybe you'll have some neat new feature by then!)

I had actually been doing that, but because of the way we're building things, it seems like image keys are preferred. Although I guess I could use image keys in the reuse content... except, I think that puts me back to my original spot, where changing out the image leaves the wrong alt text behind.
Luckily we're currently exporting largely to PDF, so it may not issue for a little while.
(Maybe you'll have some neat new feature by then!)
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Alt text and KeyRefs
Hi Stacey,
We cannot implement such an improvement on our side unless it becomes part of the DITA standard.
I wrote an email about your situation on the DITA technical committee's mailing list:
https://lists.oasis-open.org/archives/d ... 00000.html
Who knows, maybe a future version of the DITA standard will have provisions for this.
Regards,
Radu
We cannot implement such an improvement on our side unless it becomes part of the DITA standard.
I wrote an email about your situation on the DITA technical committee's mailing list:
https://lists.oasis-open.org/archives/d ... 00000.html
Who knows, maybe a future version of the DITA standard will have provisions for this.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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