cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

FOSI clean up

ebheadrick
1-Visitor

FOSI clean up

Hi,

I want to do some FOSI clean up and just wanted to run by someone what I am thinking to make sureI am not creating a mess. Also if you were having to modify this code which style is easier to maintain? I know everybody has there own style to FOSIs, but I was just curious which way more people do it. 🙂

Original FOSI:
<e-i-c gi="example" context="listitem" occur="all">
<charlist inherit="1">
<indent inherit="1" leftind="@" firstln="*"/">
<reset resetlist="admonishment.cnt"/">
</charlist>
<att>
<specval attname="role" attloc="example" attval="phraseology"/">
<charsubset>
<usetext source="phraseology.txt,!:!">
<subchars charsubsetref="block" bold=" prespace_force_2=" keep_next_col_7&quot;=">
<indent inherit="1" leftind="@" firstln="*"/">
</subchars>
</usetext>
</charsubset>
</att>
<att>
<specval attname="role" attloc="example" attval="#NONE"/">
<charsubset>
<usetext source="example.txt,!:!">
<subchars charsubsetref="bold" keep_next_col_7&quot;=">
<indent inherit="1" leftind="@" firstln="*"/">
</subchars>
</usetext>
</charsubset>
</att>
</e-i-c>

Clean up:
<e-i-c gi="example" context="listitem" occur="all">
<charlist inherit="1" charsubsetref="bold" keep_next_col_7&quot;=">
<indent inherit="1" leftind="@" firstln="*"/">
<reset resetlist="admonishment.cnt"/">
</charlist>
<att>
<specval attname="role"attval="phraseology"/">
<charsubset>
<usetext source="phraseology.txt,!:!">
<subchars charsubsetref="block" prespace_force_2&quot;=">
</subchars>
</usetext>
</charsubset>
</att>
<att>
<specval attname="role" attval="#NONE"/">
<charsubset>
<usetext source="example.txt,!:!">
<subchars charsubsetref="">
</subchars>
</usetext>
</charsubset>
</att>
</e-i-c>

Thanks, Ellen

4 REPLIES 4

It's always fun refactoring to remove lines of redundant code. 😉

Moving duplicate charsubsetrefs to the charlist makes sense.

You could also move the charsubsetref for block, so that your resulting FOSI code would looks as shown below.

Regards and Happy New Year,
Jason

<e-i-c gi="example" context="listitem" occur="all">
<charlist inherit="1" charsubsetref="block" bold=" keep_next_col_7&quot;=">
<indent inherit="1" leftind="@" firstln="*"/">
<reset resetlist="admonishment.cnt"/">
</charlist>
<att>
<specval attname="role" attval="phraseology"/">
<charsubset>
<usetext source="phraseology.txt,!:!">
<subchars charsubsetref="prespace_force_2">
</subchars>
</usetext>
</charsubset>
</att>
<att>
<specval attname="role" attval="#NONE"/">
<charsubset>
<usetext source="example.txt,!:!">
<subchars charsubsetref="">
</subchars>
</usetext>
</charsubset>
</att>
</e-i-c>

Ellen,

I recommend minimizing code because it makes future maintenance easier. For example, if the indent amount changes in your code, two edits are needed in the original FOSI code, but only one edit is necessary in the clean up code.

That said, it can be helpful to code charsubsets that may not be needed to obtain the desired formatting, but which act as useful comments. For example, an element name could be <abcd>, which reveals nothing, but a para charsubset coded in its e-i-c says everything.

Good luck!
Suzanne Napoleon
"WYSIWYG is last-century technology!"



Hi,

Another clean up question. I would like to simplify the pagesets in the FOSI and I know I can use pageref, but I am not sure whichelements it reallycovers. Does anybody have an example? Can I define the intentionally left blank page once? There just seems like there is an easier way.

Thanks for all the help so far.
Ellen

Ellen,

I added the section on pagedesc from Essential FOSI to my website. Go to




Announcements

Top Tags