DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion TOPLEAF: Cannot get image to bind to previous paragraph

  • jlm05

    TOPLEAF: Cannot get image to bind to previous paragraph

    Participants 4
    Replies 5
    Last Activity 10 years, 8 months ago

    I'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.

    Reply

    gjn2066

    Reply to: TOPLEAF: Cannot get image to bind to previous paragraph

    The 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

    Reply

    jlm05

    Reply to: TOPLEAF: Cannot get image to bind to previous paragraph

    Thanks for responding.

    We don't use the fig tag for images. Our markup is typically just:

    Previous paragraph.

    Janice

    Reply

    gjn2066

    Reply to: TOPLEAF: Cannot get image to bind to previous paragraph

    I 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

    Reply

    jlm05

    Reply to: TOPLEAF: Cannot get image to bind to previous paragraph

    I 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

    Reply

    gjn2066

    Reply to: TOPLEAF: Cannot get image to bind to previous paragraph

    Strange. If you removed the enclosing

    , the bind should have worked fine.

    If you send me the stylesheet I could have a look at what's happening.

    Geoff

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support