Merge Conditional and Register Woes

I have a publication where there are two things I need to figure out. First I need to split off some of the chapters. We made a tag for the Portfolio Classification, and for the specific chapters the <portclass> is SS. letters, not a number. I'm able to capture that in a register, but it doesn't look like the register will work with letters. Should it work with letters? Or is there a way to assign a number to "SS" so I can use that as my conditional?

Next question: in the footer, I want to show the first two levels of the section numbers. See the screen grab. If I use the bna.id, I get the 2400 and two decimal points. If I use the bnaidhf, I get a string of numbers depending on the level. I want 2400.2., which is bnaidhf level 2:

<bnaidhf;2;2400;1>

where 2 is the level and the 2400 and 1 are what I want in the footer. I don't know how to capture the two parts like that.

Thank you!

-Carol

 

  • Hi Carol,

    I wonder if for the <portclass> value that is a string (rather than a number), e.g. "SS", you could store the value in a text register and store value(s) you want to compare against in other text registers and then use <tt> to compare two text registers to do your conditional tests. That might be easier than doing something like "invoking Perl" in order to hash a <portclass> value string into a number.

    As far as your question about section numbers you are trying to output in footers, you've not given sufficient information (for me) on what the <bna.id> and <bnaidhf> macros are actually doing for me to suggest anything. Perhaps other customers will understand better the context of what you're talking about and can suggest something in that area.

    Jonathan Dagresta
    RWS Group/
    XPP Development

  • Hi Jonathan,

    I searched through our styles to see if I could find an example of <tt> or %treginfo in use, but no luck. From what I can tell, the text register in <portclass> will capture whatever is there, whether it's "SS" or something else. <tt> looks like it compares two different text registers, not different things that can be captured in one text register. Or am I missing something? Is there a more detailed description than what's in the manual?

    <bna.id> expansion is:
    <px;;22>$2.$3.<mc;$$4;bnaid2($4);nul><mc;$$5;bnaid3($5);nul><pa>

    <bnaidhf> expansion is:
    <px;;11>$2.$3.<mc;$$4;bnaid2($4);nul><mc;$$5;bnaid3($5);nul><mc;$$6;bnaid4($6);nul><mc;$$7;bnaid5($7);nul><mc;$$8;bnaid6($8);nul><mc;$$9;bnaid7($9);nul><pa>

    The documents have content groups which are nested, which generates the levels of the IDs.
  • Hi Carol,

    I'm not aware of any more detailed description of <tt> than what's in the manual.

    I was suggesting, if there were a limited number of these possible <portclass> captured text values (e.g. "SS", "TT", "VV"), that you could store each of those possible values in separate text registers (so three text registers for my example). Then you could use <tt> to compare what is in the <portclass> captured text register with each of the possible value text registers to see which is a match. This is only feasible if the number of possible values that you want to match against is fairly small.

    Otherwise, you'll probably need to figure out how to use Perl to hash the <portclass> value into a number to test against (as you mentioned) - but I'd think you'd still run into the same challenge in having to know what the hash value is for all possible <portclass> values (if you're trying to "match" on the hashed value).

    As far as your question about section number in footers, you can see that the <bna.id> and <bnaidhf> macros for which you've given the definitions call all sorts of other macros where you've not given the definitions.

    Again, I myself find it hard to give any suggestions without more context of the actual sample (data and setup) and more details about what you're trying to do. For example are you trying to add something to the data stream in the footer to output what you want (like making up a new macro to enter in the data), or are you trying to output something in the footer from values that are captured elsewhere?

    In any case, unless some other customers understand your situation better and are willing to chime in, I suggest that you need to open a Case with Customer Support and provide your data and more details and perhaps engage Professional Services if that's needed.

    Jonathan Dagresta
    RWS Group/
    XPP Development

  • Hi Jonathan,

    What I'm trying to do is differentiate the chapters with the "SS" text from the others. I would have to detect the difference in order to put them into different text registers.
    What I want is to detect when the info between <portclass> and <!portclass> is SS, and use that as the condition of a Merge Conditional.

    For the bna.id and bnaidhf portion, currently it's set up to use the content group ID numbers up to six levels. I want to only capture the first two levels of content group IDs, which can be a new macro, once I can separate the "SS" chapters from the others.
  • Looking at my manual, on 2-20, I see a merge conditional example:
    <mc;${name="Wisconsin"};bold;nul>
    I'm trying to adapt it to work with ${portclass="SS"} but that's not working. Is there a way to make that work?
  • Carol,

    I'll say again that in this forum I've gone as far as I can with suggestions.

    If no other customers have any input, you really need to open a Case with Customer Support and/or engage Professional Services.

    As far as the merge conditional you reference in the XyMacros manual, that's an example of testing the "name" attribute of a <tag> (with the syntax being used it could be the "name" attribute of the current tag or an ancestor tag still active in the tag hierarchy) - but that only works if you're in a CSS/XML/SGML division.

    You've given me the impression that SS is text between your <portclass> and <!portclass> tags, not an attribute of a tag, and anyway I can tell from your screen snap that you initially posted that this is not in a CSS/XML/SGML division.

    That's all I can contribute on your questions. Sorry I couldn't be of more help.

    Jonathan Dagresta
    RWS Group/
    XPP Development

  • I've had some success with the info that shows up in the footer. Below is the original, with red added:

     

    Here I was able to change the footer two 2 places in the ID, and it's blue:

     

     

    But then I tried it with the merge conditional. I still don't have that side of it working, but I do get the default when I make that to be A or B. I can see it is using the conditional macro because I still get the red or blue. For each one, I get no numbers:

     

     

     

    Any idea why it would do that, and how I can fix it?

  • Hi Carol,

    Do you need to pass the variables received in bnaidhf to bnaidhf_A and bnaidhf_B?

    <mc;x21=99;bnaidhf_A($1,$2,$3);bnaidhf_B($1,$2,$3)>.
  • Have you solved your "SS" problem yet? If not, maybe take a look at the <sc> Xymacro. This converts character strings to decimal numbers. This would seem to give "SS" a specific value that you could then test for in a merge conditional.

    As for the merge conditional, I may be thick, but I don't feel I have enough information here. I presume the "footer" you talk about is the frill block at the bottom; have we seen the macro that is being used to read out this information?
  • Lee, I did try something else -- "A" has that group of 6 MCs that "B" does not have. Instead of banidhf just being a MC, I set the 6 MCs from "A" to be added in. But that still does not work, either way I just get the numbers to two places as I set "B" to do. See the screen grab below: