CSS Cross Referencing

Hi All

I have the following code in my CSS:

cross_reference[ID*="ALDF_"] {
	-xpp-xref-refer: attr(ID) foot this none;
}

cross_reference[ID*="ALDF_"]::before {
	content: -xpp-macro(ri, '%refpg4');
}

footnote {
	display: block;
	-xpp-xref-mark: attr(id);
}

footnote::before {
	content: -xpp-macro(i1, '16pt') -xpp-macro(sup) -xpp-macro(ri, '%refnum') -xpp-macro(reset) "\2009";
}

And this works fine - however if I change %refpg4 to %refnum each cross reference reports the "current" footnote %refnum rather than the one the the id reference is pointing to.

Just to reassure you the footnote has an attribute id= but the cross ref has ID=.

Any suggestions very welcome!

Chris

Parents
  • I don't think I agree with Bart's conclusions.

    Chris already mentioned that the ID (and I assume id) attribute values are actually both ALDF_###### values and it was just that Chris over-simplified the XML snippet he gave. Yes, the attr(ID) and attr(id) values will be the full ALDF_###### attribute values (and not any subset being matched with the attribute selector), but as long as they match in both elements this should be fine.

    And although the description of the %refnum system variable does not explicitly mention the <rf> macro (as it does with %refpage and %refpg1 - %refpg6), if you go to the documentation for the <rf> macro it does mention in the Comments that "it stores the pickup and footnote reference numbers in %refnum". Doing -xpp-xref-refer should be the equivalent of doing an <rf>.

    I'm still not seeing why it's not working for you. If you don't have any success, you might need to open a ticket and submit a sample.

    Jonathan Dagresta
    RWS Group/
    XPP Development

  • I agree with Jonathan's comments above - the documentation specifically mentions %refnum - I will do some more playing tomorrow and report back - suffice it to say that %refpg4 is working perfectly with the above CSS and "real" data - its only when I substitute %refpg4 with %refnum that it changes behavior and only reports the "current " %refnum rather than the one that is referenced in the cross-reference macro.

    As Bart says I may need to use Perl (either on import or interactively) to sort the outputting of text - the files are very large and I am worried about the limit of 255 text registers. However I think the %refnum should work out the box as per the CSS and XyMacro documentation.

  • Jonathan - I have done more testing and have now opened a ticket (00627228).

  • Yes, inside the main stream when you do an <rf>, the %refnum will give you back the number of the referenced footnote.
    But inside a footnote (stream) %refnum is supposed to give you back the number of the current footnote. (see the definition of the footnote::before above).

    And what Chris is trying to do is to reference a footnote from another footnote, which explains why %refpg4 is working but %refnum is giving back the number of the current footnote. (which it should). This is in my eyes not a bug but has always been this way by design.

    And if Chris wants to cross ref and get the actual text fragment back, he will have to revert to xyPerl anyhow, so he might as well use xyPerl to get the number of the referenced footnote.

  • If you look in the environment jobs that come with the system go to the GRP_comp/JOB_footnotes/DIV_1-footnote page 2:
    Footnotes can only be referenced in the main-text
    stream. If the footnote reference xymacro is inserted
    in a story, pickup or frill stream, or in a table, it will
    be ignored. See the division <bold>a3-endnote<med> for an
    example of manually inputting a footnote reference
    symbol in one block, and referencing the footnote in
    a different block.

  • Good catch, Bart.

    I missed that detail (when I first looked at the code) and that the -xpp-xref-refer (or <rf>) in the cross_reference element was being done inside a footnote.

    It is indeed the case (after looking at the code again) that when within a footnote (or pickup) that %refnum ignores any <rf> and instead just returns the reference number of the current footnote/pickup.

    Other reason I missed that is that I don't see that this behavior is explicitly stated in the documentation, at least not with <rf>. Oh well.

    To make it easier to do what you are trying to do, I guess we would need to add a different system variable (to use in a footnote/pickup) that would return the footnote/pickup reference number value set by <rf>.

    Although, I'm thinking that for most customers that this is a very unusual use case to need the reference number of another footnote within a footnote.

    Jonathan Dagresta
    RWS Group/
    XPP Development

Reply
  • Good catch, Bart.

    I missed that detail (when I first looked at the code) and that the -xpp-xref-refer (or <rf>) in the cross_reference element was being done inside a footnote.

    It is indeed the case (after looking at the code again) that when within a footnote (or pickup) that %refnum ignores any <rf> and instead just returns the reference number of the current footnote/pickup.

    Other reason I missed that is that I don't see that this behavior is explicitly stated in the documentation, at least not with <rf>. Oh well.

    To make it easier to do what you are trying to do, I guess we would need to add a different system variable (to use in a footnote/pickup) that would return the footnote/pickup reference number value set by <rf>.

    Although, I'm thinking that for most customers that this is a very unusual use case to need the reference number of another footnote within a footnote.

    Jonathan Dagresta
    RWS Group/
    XPP Development

Children