Skip to main content
10-Marble
April 14, 2010
Question

Start Counting from Attribute Value

  • April 14, 2010
  • 4 replies
  • 853 views

Is it possible to take the value of an attribute and use thatset the initial value of a counter?If so can you point me in the right code direction??!!

Thanks in advance for your help.


Sarah Copley

    4 replies

    1-Visitor
    April 14, 2010
    I have never done this, but it seems like you ought to be able to use a FOSI <att> with a fillval that creates a setval attribute value on an <enumerate> element with a given enumid attribute vale.

    Such as, assuming the attribute on your e-i-c is called "number":
    <att>
    <fillval attname="number" fillcat="enumerat" fillchar="setval">
    <charsubset>
    <enumerat enumid="[your" counter=" name=" goes=" here]&quot;=">
    </att>

    Like I said, I have never actually done this, but it seems like it should work.
    10-Marble
    April 14, 2010
    Thanks for pointing me in the right direction. I got it to work by using this code:



    <att>

    <fillval attname="number" fillcat="enumerat" fillchar="increm">

    <charsubset>

    <enumerat enumid="step1.ct" setvalue="1">

    </charsubset>

    </att>





    Sarah R. Copley




    1-Visitor
    April 14, 2010
    FWIW: We use a structure like this:
    <att>
    <specval attname="label" attval="#ANY">
    <fillval attname="label" fillcat="savetext" fillchar="conrule">
    <charsubset>
    <savetext textid="chapternumber.txt">
    </att>

    chapternumber.txt is enumerated earlier in the e-i-c. This specval
    overrides/resets/sets normal enumeration. In some documents, all chapters
    have label set so chapters number properly outside of the document. On other
    documents, no chapters have label set because they're only ever reviewed as
    documents. You can't mix and match for long without stepping on your own
    toes.

    On lists (<att> not shown), this same strategy allows authors to manage
    lists across otherwise-resetting boundaries. Like table rows. Don't ask.


    On Wed, Apr 14, 2010 at 9:43 AM, Copley, Sarah CTR
    <sarah.r.copley@uscg.mil>wrote:

    > Thanks for pointing me in the right direction. I got it to work by using
    > this code:
    >
    >
    >
    > <att>
    >
    > <fillval attname="number" fillcat="enumerat" fillchar="increm">
    >
    > <charsubset>
    >
    > <enumerat enumid="step1.ct" setvalue="1">
    >
    > </charsubset>
    >
    > </att>
    >
    >
    >
    >
    >
    > *Sarah R. Copley*
    >
    >
    >
    > *From:* - [mailto:-] *On
    > Behalf Of *Benton, Ed L
    > *Sent:* Wednesday, April 14, 2010 12:25 PM
    >
    > *To:* -
    > *Subject:* [adepters] - RE: Start Counting from Attribute Value
    >
    >
    >
    > I have never done this, but it seems like you ought to be able to use a
    > FOSI <att> with a fillval that creates a setval attribute value on an
    > <enumerate> element with a given enumid attribute vale.
    >
    >
    >
    > Such as, assuming the attribute on your e-i-c is called โ€œnumberโ€:
    >
    > <att>
    >
    > <fillval attname="number" fillcat="enumerat" fillchar="setval">
    >
    > <charsubset>
    >
    > <enumerat enumid="[your" counter=" name=" goes=" here]&quot;=">
    >
    > </att>
    >
    >
    >
    > Like I said, I have never actually done this, but it seems like it should
    > work.
    >
    >
    >
    > *From:* Sarah Copley [mailto:sarah.r.copley@uscg.mil]
    > *Sent:* Wednesday, April 14, 2010 11:53 AM
    > *To:* -
    > *Subject:* [adepters] - Start Counting from Attribute Value
    >
    >
    >
    > Is it possible to take the value of an attribute and use that set the
    > initial value of a counter? If so can you point me in the right code
    > direction??!!
    >
    > Thanks in advance for your help.
    >
    >
    > *Sarah Copley*
    >
    >
    >
    1-Visitor
    April 14, 2010
    Oh yeah, another limitation is that it is possible to confuse FOSI by
    setting the label to "forty-seven" rather than 1, 2, 3, etc.