DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Page Preview doesn’t work when there is a conditional attribute in root element

  • Stoobie

    Page Preview doesn’t work when there is a conditional attribute in root element

    Participants 4
    Replies 5
    Last Activity 12 years, 9 months ago

    I'm using XMetaL Author Enterprise 6.0 on Win XP SP3.

    When I try to do Page Preview, it doesn't work if I have a conditional attribute applied to the root element of the topic.

    For example, a topic with the following root element produces an error:

    But when I remove  platform="Linux"  page preview works.

    Here's the error I get:
    “The deliverable could not be created. If a file with the same name is open in another application, close the file and then generate output again.”

    The log file says:

    C:DOCUME~1myuserAPPLIC~1SoftQuadXMETAL~1DITA_OTbuild_preprocess.xml:41: [DOTJ034F][FATAL] Failed to parse the input file 'myfile.xml' due to the content of the file is not valid. If the input file 'myfile.xml' does not have or refer to the DOCTYPE declaration.Please make sure it has all class attributes present in the file.


    Derek Read

    Reply to: Page Preview doesn’t work when there is a conditional attribute in root element

    It sounds like you want the entire topic to be excluded from output but the file is being included without the root element and is therefore invalid. You should probably see the same issue if you select File > Generate Output for DITA Topic…

    Page Preview generates output using the deliverable type you set in Tools > Configure Output… > Preview (tab).

    It picks up the last set of conditions you set in the “Show/Hide Conditional Text” dialog you get to when you generate output via File > Generate Output for DITA Topic/Map…

    I don't want to say what you are doing is wrong (you may have some other process that handles this), but I would not recommend it if you use maps and the DITA OT to produce output. If you generate output from a map that includes a reference to this topic file and conditionalizing excludes the root element in that topic some deliverables (the DITA OT calls these transtypes) may include the topic in the navigation portion of the output (assuming it has one) while excluding the content from the output. So, for example, in CHM the Contents panel may display the title of your topic, but clicking on it will either take you nowhere, raise an error or display an empty page. This is likely not what you want. But again, you may be feeding this content into another system or a patched version of the DITA OT that does handle this, or producing output to deliverables that do not have this issue, so I cannot say for sure. PDF for one seems to be OK whereas most or all of the HTML-related outputs are not.

    Conditionalizing entire topics at the map level (on a element) avoids this issue for all deliverables as far as I know.

    To me it also seems cleaner to do this at the map level, but that doesn't mean it will fit with your process or design.



    Reply to: Page Preview doesn’t work when there is a conditional attribute in root element

    Aha…that info helped.

    Understand that in our group of writers, none of us has a lot of expertise with this tool. We pretty much know what we're told to know, and we generate output directly through the DITA OT, not via XMetaL. So I didn't know about File> Generate Output for DITA Topic. In fact, I was wondering how XMetaL knew which conditions to show and which to hide. I still wonder that, because, as I mentioned, Page Preview did work, just not when I had a condition in the root element.

    Anyway, my only complaint is that it takes a very long time to generate output/do Page Preview for the topic. Is that normal? Why is Page Preview so much quicker when there is no condition in the root element?


    Derek Read

    Reply to: Page Preview doesn’t work when there is a conditional attribute in root element

    It should be that much longer, in my testing it might take an extra 500 milliseconds or so, but I'm not even sure of that because processing a single topic only takes a few seconds in total in my testing.

    The stuff that is going on here when you conditionalize is the preprocessing that the DITA OT does. It takes all of the topics referenced in a map and sticks them all in one big XML document, this is then parsed further. Conditionalization happens during this phase. If you ask the DITA OT to generate output for just one topic it still goes through a similar step, making what amounts to a fake map containing that one topic.

    The only difference between Page Preview and using the General Output for DITA Topic option on the File menu is that the resulting file is then opened inside a copy of IE sitting in the Preview window.



    Reply to: Page Preview doesn’t work when there is a conditional attribute in root element

    Gotcha. Thanks for the info, Derek.

    I took a look at the ditaval that XMetaL generates, and it includes conditions that are not defined anywhere in our ditavals.

    I don't know if this has anything to do with the amount of time it takes to generate PagePreview output or not, but do you know what I'm talking about and why this is happening?


    Derek Read

    Reply to: Page Preview doesn’t work when there is a conditional attribute in root element

    I'm not sure I understand exactly. Which ditaval files are you comparing? I'll take a stab at answering anyway though, making some assumptions.

    It sounds like you have a complex setup where you are previewing your documents by generating output through our UI using the copy of the DITA OT that we install but don't actually use that for production and use a completely separate copy of the DITA OT for that, in which case I'm not surprised the two are different because XMetaL Author generates ditaval files based on how you have configured it and the settings you choose in a dialog called Show/Hide Conditional Text.

    Perhaps you have configured your copy of the DITA OT to use a particular set of ditaval files but not done anything to configure XMetaL Author Enterprise to generate similar values. When you generate output using our product the ditaval file is generated based on the settings you select (or do not select) in the Show / Hide Conditional Text dialog. If you never open that dialog the ditaval file that is generated is still based on the configuration that drives that dialog.

    You will likely want to read these topics if that is the case:

    • Conditional text (this topic is the main topic in this section)
    • Creating and modifying conditions (a subtopic of the one above, this talks about the configuration)

    You can also tell XMetaL Author Enterprise to use a specific ditaval file instead and not generate one based on those values. This is done in the Advanced Show / Hide Contional Text dialog (via File > Generate Output for DITA Topic/Map > Show/Hide Conditional Text > Advanced). In that dialog select the radio button “Use the following settings file” and then select a ditaval file from the list.

    The list shows files that you have exported to the following folder using the Export button: C:Program FilesXMetaL 6.0AuthorDITAXACssharedrenditionsfilters

    When you click the Export button the file that is saved contains the settings you chose from the Show/Hide Conditional Text dialog, so if you have not configured that dialog to show the values you use then you will be seeing the default values we ship with (which few people actually use and that almost everyone will need to configure according to the second help topic I have listed above).

    You may also manually copy ditaval files into that folder if you wish to create them using another tool. All *.ditaval files are listed in the dropdown.


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

Lost Your Password?