DITA and XMetaL Discussion
XMetaL Community Forum › DITA and XMetaL Discussion › TOPLEAF: Cannot get image to bind to previous paragraph
-
jlm05 January 11, 2012 at 9:06 pm
TOPLEAF: Cannot get image to bind to previous paragraph
January 11, 2012 at 9:06 pmParticipants 4Replies 5Last Activity 11 years agoI'm trying to configure the stylesheet so that images do not display at the top of a page – they should always be with the previous paragraph, which often contains some information about the image.
I've tried configuring the image tag to bind to the previous paragraph, but because image tags are always within p tags, that doesn't work.
Even if I insert an image tag without an enclosing p tag, the images is not with the previous paragraph.
Is there any way to configure this? Can I set up a context so that paragraphs that contain image tags are bound to the previous paragraph? The information in the Mapping Guide would seem to indicate that you can only set up a context to find a tag within a tag, not a tag that contains another tag.
gjn2066 January 13, 2012 at 3:11 am
Reply to: TOPLEAF: Cannot get image to bind to previous paragraph
January 13, 2012 at 3:11 amThe answer depends on the form of markup you are using. I am currently looking at an example with the following structure:
Previous para.
and the [u]Bind to previous[/u] is set on the fig rather than the image.
This seems to work fine. If the image has an associated title (before or after), it can be included in the bound material by also setting [u]Bind element content[/u] on fig.
Does this sound as if it might apply to you? If not can you provide more specific details of your markup.
Geoff
jlm05 January 13, 2012 at 1:09 pm
Reply to: TOPLEAF: Cannot get image to bind to previous paragraph
January 13, 2012 at 1:09 pmThanks for responding.
We don't use the fig tag for images. Our markup is typically just:
Previous paragraph.
Janice
gjn2066 January 16, 2012 at 4:19 pm
Reply to: TOPLEAF: Cannot get image to bind to previous paragraph
January 16, 2012 at 4:19 pmI think I see what's happening. Setting the [u]Bind to previous[/u] on the image is binding to the (otherwise empty) enclosing para. But this para is not itself bound to the preceding para. My solution worked because the enclosing fig element [u]did[/u] bind to the previous para.
This is a case where the available markup is not really adequate to fully express your requirements, but there are a couple of minor changes which could get you the desired result:
- If the image has to bind to the previous para, then it must itself be a [u]block[/u] element and therefore needs no enclosing p. Once this is done, the bind on the image will be effective.
- If the image is regarded as an [u]inline[/u] element, then it can't do any para binding itself. In this case you will need some means of applying the bind to the enclosing p, which would then act like fig in my earlier example. Suggest something like:
…preceding text…
Does this help?
Geoff
jlm05 January 17, 2012 at 1:58 pm
Reply to: TOPLEAF: Cannot get image to bind to previous paragraph
January 17, 2012 at 1:58 pmI had earlier tried having the image as a block element without the enclosing
, but the binding still didn't work.
I think the most structurally sound option would be to change the
to
. Tedious but doable, and this is a fairly minor issue. Thanks again for your help,
Janice
-
AuthorPosts
- You must be logged in to reply to this topic.