12 Replies Latest reply on Oct 17, 2007 5:00 AM by Kristian_Samuelsson

    Trouble with conditional build tags

    Kristian_Samuelsson
      I'm having problems with conditional build tags that don't seem to work at content level in some of my help topics. I've got two tags that each correspond to a specific version of the software the help is intended for. Let's call the tags A and B.

      I'm using these tags in the following manner:
      - Some parts of some topics are valid for both versions of the software, and are thus left untagged.
      - Some parts of some topics are valid for only one version, and is tagged correspondingly with either A or B.
      - No text is ever tagged with both A and B.

      Now, the following problems arise with some of the topics - but not all - tagged in this way:

      - When generating output (irrespective of what type of Single Source Layout is used) all the topic's contents are published, no matter how it is tagged. The conditional build expression used is either "A AND NOT B" or the other way around: "B AND NOT A".

      - When generating printed documentation (Word), the tagging comments are brought along with the tagged content into the generated document, but still, all content, irrespective of tagging, is published for these topics (but once again, not all topics).

      I have tried to find out if there is any difference at all between the topics that work as expected and those that don't, but have found none. I have also tried the "saving-in-txt"-trick suggested in another thread to no avail.

      The project was created in ancient times using RoboHelp Office X4.1, where the problem was first noted as we recently started employing conditional build tags extensively. I have also tried using (an evaluation copy of) RoboHelp 6 for Word but the result remains the same.

      Copying the topic content into new topics in a new project (in RoboHelp 6 for Word) seems to have resolved the problem, but in a project with literally thousands of topics, this isn't really a viable option, except as an absolutely last resort. I'm a software developer, after all, not a full-time technical writer.

      Has anyone experienced similar problems and is there a simpler solution than copying all topics into a new project?

      Thanks in advance,
      Kristian
        • 1. Re: Trouble with conditional build tags
          RoboColum(n) Level 5
          What I'd try is to change the conditional build expressions. If you use just "NOT A" you'll get all the untagged text plus the text tagged with "B". Likewise NOT B gets all the untagged text plus the text tagged with "A". Build expressions normally work on the basis of exclusion.
          • 2. Re: Trouble with conditional build tags
            Kristian_Samuelsson Level 1
            Ah, okay. I got that bit of my post wrong. What I actually do is use a conditional build expression fo the following kind: "NOT A AND NOT C" where C is used for an older version of the software.

            The problem is that even though I've specifically excluded the "A" content it still shows up inte the output along with the "B" content.

            Any thoughts on why this does not work in my old project but does work very well indeed when the old content is copied into new topics in a new project? Could there be some old traces of junk in the old X4.1 project .docs that screw the topics up?
            • 3. Re: Trouble with conditional build tags
              RoboColum(n) Level 5
              Very possibly Kristian. I could be wrong here but I believe that build tags were introduced in X4 so have come a long way since then. You may want to try removing and adding the build expressions. With a bit of thought you may be able to use a find and replace tool to do this.
              • 4. Re: Trouble with conditional build tags
                Kristian_Samuelsson Level 1
                quote:

                Originally posted by: Colum McAndrew
                You may want to try removing and adding the build expressions.


                Do you mean remove and replace the build tags?

                I've also considered the possibility of writing a "preprocessing" macro to simply format all unwanted tagged content as "hidden" before generating the SSL...
                • 5. Re: Trouble with conditional build tags
                  RoboColum(n) Level 5
                  Sorry Kristian. Yes I meant build tags. It's been a long day and it's not even lunch yet
                  • 6. Re: Trouble with conditional build tags
                    Kristian_Samuelsson Level 1
                    Okay, thanks, I'll try that. Thanks for your help, or willingness to help at least. :)
                    • 7. Re: Trouble with conditional build tags
                      RoboWizard Level 4
                      Hi Colum

                      Just a bit of trivia here. For RoboHelp HTML, build tags themselves appeared in the product in version 2000 (logically, version 8). Version X3 introduced the ability to apply them at the content level (applying to individual words, characters or images).

                      Cheers all... Rick
                      • 8. Re: Trouble with conditional build tags
                        RoboColum(n) Level 5
                        Blimey Rick. Was it really that long ago. I feel really old now.
                        • 9. Re: Trouble with conditional build tags
                          HKabaker Level 2
                          It may be worth taking a minute to look at the html code for the topics that don't work the way you expect them to work.

                          Generally, tagged text starts with an "x-condition" span and ends with a < / span>

                          Sometimes the x-condition goes inside a "style = " phrase or into the opening span tag for another trait.

                          That's all OK usually. But sometimes when you apply and unapply tags, or reapply a previously removed tag, the source code becomes confused. End-span tags get lost, or the begin/end tags become nested or overlapping. When the tag code gets jumbled, you can't straighten it out from the WYSIWYG editor.

                          You say the problem occurs in some but not all situations. Maybe you can simply remove all tags from the problem topics only, and carefully apply them from scratch.

                          Harvey
                          • 10. Re: Trouble with conditional build tags
                            HKabaker Level 2
                            I should add that starting a new project and importing tagged topics may cause a problem.

                            Make sure you know exactly which tags are in the topics to be imported, and create those tags in the new project before you import topics. In other words, when RH sees an incoming tag it doesn't already know about, it may or may not keep the incoming tag. If it keeps the mystery tag, and later you create a tag of the same name, RH may not associate the two.

                            Harvey
                            • 11. Re: Trouble with conditional build tags
                              Gravenstein Level 2
                              Further to Harvey's post, I've also seen RH respond badly to old tags that got imported with topics, but were never created in the new project. I don't know at what point this occurs, but RH will sometimes repeat instances of the bogus tag inside the topic. So, let's say you start off with this tag inside your topic: <meta name="build tags" content=bogus_tag>. After a while, RH sometimes compounds the problem, and the tag ends up looking like this: <meta name="build tags" content=bogus_tag,bogus_tag,bogus_tag,bogus_tag>. Or worse. The strings can get quite long. (It might use semicolons instead of commas. I don't remember now.)

                              The bad thing is that this tends to happen totally without you realizing it, until you run into some kind of erratic behavior in the affected topics.

                              G
                              • 12. Re: Trouble with conditional build tags
                                Kristian_Samuelsson Level 1
                                First off: thanks for all the feedback, everyone! Next, a clarification: I'm working in RoboHelp for Word, not the HTML version, so there is no code to examine (or is there?).

                                I have tried importing the project (.hpj-file) into RH for HTML, but have run into the problem with disappearing build tags described in the knowledge base. Following the instructions there, I've been able to recreate the tags themselves, in the sense that they were finally to be found in the Conditional Build Tags list. I have not, however, been able to recover my topic/content "tag state", meaning simply that the tags have not been applied to my help content, neither at topic nor at content level.

                                Is there a trick to this that I'm missing or will I have to reapply tags to the entire project?