DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Correct Behaviour of Output with Conditional Attributes

  • edwardwoodward

    Correct Behaviour of Output with Conditional Attributes

    Participants 8
    Replies 9
    Last Activity 9 years, 2 months ago

    Hello,
    Using XMetaL Author Enterprise Edition 6.0J .

    I'm trying to work out what the correct behaviour is when generating output using conditional attributes. I'm confused because:

    If I set a single attribute in a topic (eg, audience=user) but set multiple attributes for the build (eg, audience=user, platform=windowsxp etc), the topic is displayed in the build.

    But

    If I set multiple attributes in a topic (eg, audience=user, platform=windowsxp etc) but ony set one of those for the build (eg, audience=user), the topic is not displayed in the build.

    Is this correct? (This happens even after deleting ct_preferences.) I found this line in the English Help, but I'm not too sure if this means the above behaviour is correct or not:
    “Content that is common to all deliverables (that is, content that has no conditions applied), plus content that matches at least one selected value for each attribute will be shown.”

    Cheers.

    Reply

    gcrews

    Reply to: Correct Behaviour of Output with Conditional Attributes

    I think by default XmetaL creates a DITAVAL file from the output option dialog with any non selected items set as excluded. If it didn't include it at all then it would be included by default.

    You can verify this by looking at the temporary ditaval file XmetaL creates during output in the ┬átemp, output, or source folder or wherever it creates it…

    Reply

    edwardwoodward

    Reply to: Correct Behaviour of Output with Conditional Attributes

    Thanks for the reply.

    Yes, I checked the ditaval file and it has one item set to “include” and all others set to “exclude”.

    I'm wondering if this is correct behaviour because it seems to contradict the description in the help, which suggests (to me) that if any of the set items match, the topic will be displayed.

    If that's the way it is, then fair enough, I'll just find a way to work around it. Seems odd, though.

    Cheers.

    Reply

    Derek Read

    Reply to: Correct Behaviour of Output with Conditional Attributes

    Basically it works like this:
    1. Anything without a specific conditional text attribute value set is included regardless of what you select in the dialog.
    2. If something has one or more conditional text attribute values (each attribute can have more than one value) then the same value must be selected in the dialog otherwise it will not be included.

    Consider this example:

    This paragraph is for everyone.

    This paragraph is for "Windows XP" people only.

    This paragraph is for "Windows XP" and "Windows 2000" people.

    This paragraph is for "Mac OS X" people only.

    1. If you select nothing in the “Show / Hide Conditional Text” dialog (accessed via the Generate Output dialog) only the first paragraph will appear in output.
    2. If you select “windowsxp” for platform in the dialog then the first three paragraphs will appear in output.
    3. If you select “windows2000” for platform in the dialog then the third paragraph will appear in output.
    4. If you select “macosx” for platform in the dialog then the first and fourth paragraphs will appear in output.
    5. If you select both “windowsxp” and “macosx” for platform in the dialog then all paragraphs will appear in output.

    Reply

    edwardwoodward

    Reply to: Correct Behaviour of Output with Conditional Attributes

    Thanks for the reply.

    In that case, there is something wrong with my software (and my way of thinking) because I pasted your example into a topic and published with no settings selected in the “Show / Hide Conditional Text” dialog and all 4 paragraphs were published (and that's what I was expecting).

    I'm missing something, aren't I.

    Reply

    edwardwoodward

    Reply to: Correct Behaviour of Output with Conditional Attributes

    Also, the example you give is not quite the same as the example I'm asking about. To modify your example:

    This paragraph is for everyone.

    This paragraph is for “Windows XP” users.

    This paragraph is for “Windows XP” administrators.

    This paragraph is for all “Windows XP” people.

    I'm asking about the cases where there are 2 attributes set in the topic (in the above fragment, “audience” and “platform”).

    If I select “windowsxp” for platform in the “Show / Hide Conditional Text” dialog (and nothing for audience), then the first and the last paragraphs appear in output. What I don't get is why the second and third don't appear. Afterall, they both have “platform=”windowsxp””, just like the last paragraph.

    Reply

    Derek Read

    Reply to: Correct Behaviour of Output with Conditional Attributes

    I assume this is because you don't have either audience=”user” or audience=”administrator” selected?
    If you don't have either of those selected then that is the reason (and the software is working as designed).

    Reply

    edwardwoodward

    Reply to: Correct Behaviour of Output with Conditional Attributes

    “I assume this is because you don't have either audience=”user” or audience=”administrator” selected?
    If you don't have either of those selected then that is the reason (and the software is working as designed).”

    Thanks again.
    Fair enough, if that's how it's supposed to be, but I don't see how you are supposed to work that out from that line I quoted from the help, which says to me “If anything matches, the content is displayed.”

    Also, having fiddled about with conditional text a bit more, I have found that I have to close XMetal and delete ct_preferences every time I change the conditional output settings, otherwise the output will be messed up in some way – either outputs the same as the last build or only shows content with no conditional settings.

    Reply

    Derek Read

    Reply to: Correct Behaviour of Output with Conditional Attributes

    Do you mean you are editing the ct_preferences.xml file and that the changes you make don't take effect until you restart XMetaL Author? If so, that is normal as that configuration file is loaded when the software starts up.

    Or do you mean something else? If this is something else I don't think I'm familiar with it. The 6.0 release is a few years old now, so it is possible there is some issue I've forgotten about.

    I'll have a look at the help file in the current release as well (the English edition) to see if we've improved upon it.

    Reply

    edwardwoodward

    Reply to: Correct Behaviour of Output with Conditional Attributes

    “Do you mean you are editing the ct_preferences.xml file and that the changes you make don't take effect until you restart XMetaL Author? If so, that is normal as that configuration file is loaded when the software starts up.”

    No, I'm not editing ct_preferences.xml, just making changes in the “Show / Hide Conditional Text” window before output.

    There's something about this in the release notes, but using “may” instead of “will”.

    The Japanese help is a direct translation of the English and doesn't really help on this point.

    Reply

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

Lost Your Password?

Products
Downloads
Support