Pages: 1
Print
Author Topic: Info: Viewing and editing <alt> elements in images  (Read 6792 times)
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« on: January 06, 2009, 07:00:32 PM »

When displaying a document that contains an image, a limitation of XMetaL is that it cannot simultaneously show both the actual image and a sub-element of the <image> element, such as an <alt> element. You also cannot insert an <alt> element for an image if the image is displayed.

To work with <alt> elements within images, click View > Hide Inline Images. This will hide images, but allow you to view, edit, and insert <alt> elements in both Normal and Tags On views.

DITA users can also use the Insert Image or Figure or Image or Figure Properties dialogs to view, edit, and insert <alt> elements. See the additional notes below.

Additional notes on the <alt> element in DITA

The DITA 1.1 language reference says, "The alt element provides alternate text for an image. It is equivalent to the alt attribute on the image element; the attribute is deprecated, so the alt element should be used instead. As an element, alt provides direct text entry within an XML editor and is more easily accessed than an attribute for translation."

Because "alt text" can be stored in either an attribute or an element, XMetaL's dialogs for editing image properties use some special logic to support either choice:
- If the alt attribute does not have a value, anything typed into the Alt Text field goes into the alt element when the user clicks OK (the system creates an alt element if needed).
- If the alt attribute has a value, and there is no alt element, the Alt Text field displays the contents of the alt attribute, and anything in this field is saved to the alt attribute, not the element, when the user clicks OK.
- If the alt attribute has a value, and there is also an alt element, the Alt Text field displays the contents of the alt element, and anything in this field is saved to the alt element when the user clicks OK.

The dialogs are designed to encourage use of the <alt> element, while ensuring that people using the alt attribute wouldn’t have their data seem to disappear. Note that XMetaL does not move content from alt attributes to <alt> elements, or vice-versa.
« Last Edit: January 06, 2009, 07:15:57 PM by syeo » Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
ghkrause
Member

Posts: 62


« Reply #1 on: January 06, 2009, 07:38:30 PM »

Thank you for this info!
Logged

Gunnar H. Krause, TechDoc Manager, Nuremberg Area, Germany
paorear
Member

Posts: 29


« Reply #2 on: April 02, 2014, 06:36:23 PM »

It appears that this limitation is not DITA-specific, is that correct? For example, in our schema, we have an <image> element for which we display a placeholder image using 'Display As' = XFT, and the XFT is essentially just a small graphic.

I'm investigating an issue where child elements are not being displayed in this context - is that because of this same limitation?

Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2484



WWW
« Reply #3 on: April 03, 2014, 02:04:48 PM »

Correct, this is true for any schema, not just DITA.

XFT is the same, so if the XFT you are embedding replaces the element you will need to design it to cover all the content you want to allow to be editing, including child content. You have absolute control over everything in an XFT though, so if properly designed it can allow the user to see and edit all content provided you expose that content in the XFT on the controls you embed in the XFT.

If you are embedding XFT before or after an element (instead of replacing the whole element) then things get more complicated. See this thread: http://forums.xmetal.com/index.php/topic,3348.0.html
Logged
paorear
Member

Posts: 29


« Reply #4 on: April 03, 2014, 05:51:21 PM »

[XMetaL Authoring Essentials 8]

Thanks Derek - I had read that other thread yesterday as well.

Here's a scenario I'm trying to solve. I currently have the following working:

       <image>XFT placeholder image</image>

Where the XFT is embedded and essentially just a graphic to show that an image would be displayed there at rendering time.

In some scenarios, we have a child element that would make the image into a hotlink. e.g.
       <image><link></link></image>

In all these cases the data we track is in attributes of the tags themselves - not any value data between elements.

Currently, I am unable to display the <link> element in the editor, presumably due to the XFT that we have associated with the <image> element. I tried defining the XFT as embedded and to be before <image> element, but it didn't seem to have any impact either on where the XFT was displayed or whether the <link> element would also be displayed. Is what I'm trying to do possible? or perhaps I just didn't quite get it defined and setup correctly.
Logged
Pages: 1
Print
Jump to:  

email us