Pages: 1
Print
Author Topic: Correct Behaviour of Output with Conditional Attributes  (Read 4575 times)
edwardwoodward
Member

Posts: 24


« on: May 27, 2013, 05:52:16 PM »

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.
Logged
gcrews
Member

Posts: 265


« Reply #1 on: May 27, 2013, 11:04:00 PM »

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...
« Last Edit: May 27, 2013, 11:06:48 PM by gcrews » Logged
edwardwoodward
Member

Posts: 24


« Reply #2 on: May 28, 2013, 12:35:24 AM »

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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: May 28, 2013, 01:05:51 PM »

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:
<p>This paragraph is for everyone.</p>
<p platform="windowsxp">This paragraph is for "Windows XP" people only.</p>
<p platform="windowsxp windows2000">This paragraph is for "Windows XP" and "Windows 2000" people.</p>
<p platform="macosx">This paragraph is for "Mac OS X" people only.</p>


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.
Logged
edwardwoodward
Member

Posts: 24


« Reply #4 on: May 28, 2013, 05:27:31 PM »

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.
Logged
edwardwoodward
Member

Posts: 24


« Reply #5 on: May 28, 2013, 07:38:39 PM »

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


<p>This paragraph is for everyone.</p>
<p audience="user" platform="windowsxp">This paragraph is for "Windows XP" users.</p>
<p audience="administrator" platform="windowsxp">This paragraph is for "Windows XP" administrators.</p>
<p platform="windowsxp">This paragraph is for all "Windows XP" people.</p>

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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #6 on: June 03, 2013, 10:32:27 AM »

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).
Logged
edwardwoodward
Member

Posts: 24


« Reply #7 on: June 03, 2013, 11:24:49 PM »

"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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #8 on: June 04, 2013, 03:31:02 AM »

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.
Logged
edwardwoodward
Member

Posts: 24


« Reply #9 on: June 04, 2013, 07:32:05 PM »

"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.
Logged
Pages: 1
Print
Jump to: