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] Epic 5.2

NENESS
1-Visitor

[FOSI] Epic 5.2

Hello,

When a rule I place a variable value, this value is not seen in the body of the rule, how can I do so that the value of this variable to be seen?

thank you

cordially

Bonjour,

Lorsque dans une règle je positionne une valeur de variable, cette valeur n'est pas vu dans le corps de la règle, comment puis je faire pour que la valeur de cette variable soit vue ?

merci

cordialement

3 REPLIES 3
pnagai
12-Amethyst
(To:NENESS)

Hi Bruno,

I do not quite understand your question. Maybe you could provide the code you are using to place the variable value. Are you working with a FOSI? Or a Styler stylesheet?

Also, if you haven't solved this or moved on already, I suggest joining the Adepters mailing list where lots and lots of Arbortext users, admins, and developers hang out 24/7/365. Information on joining that list (as well as pointers to lots of other Arbortext resources) can be found here:

http://blog.single-sourcing.com/top-arbortext-resources

See also:

http://www.single-sourcing.com/company/social.html

Good luck!

NENESS
1-Visitor
(To:NENESS)

Hi,

I work with FOSI.

I have file SGM with

<supply mand="3">

<nomen change="mod">xxxxxxxxxxxxxxxxxxxxxxxxxx</nomen>

<quantity>4</quantity>

...

<supply mand="3">

<nomen>yyyyyyyyyyyyyyyyyyyy</nomen>

<quantity>4</quantity>

...

I treat element SUPPLY as a table

IN the rules of FOSI

<e-i-c gi="SUPPLY" context="* SUPPLIES * CONTENT">

<!-- i initialize variable -->

<charlist>

<savetext textid="va_change.txt" conrule="\0\" placemnt="before" append="0">

</charlist>

<!-- I change value of variable if attribute change = mod -->

<att>
<specval attname="child::nomen/@change='mod'" attloc="#XPATH" attval="1">
<charsubset>
<savetext textid="va_change.txt" conrule="\1\" placemnt="before" append="0">
</charsubset>
</att>

....

<!-- two different treat -->

<att logic="and">
<specval attname="MAND" attloc="" attval="#EQ#\3\">
<specval attname="va_change.txt" attloc="#FOSI" attval="#EQ#\1\">
<fillval attname="supply_id1" attloc="SYSTEM-FUNC" fillcat="savetext" fillchar="conrule">
<charsubset>
<savetext textid="tbody.app" conrule='!<row>!,!<entry colsep="0" rowsep="0">!,!<para change="mod">!,\-aa \,prcol3.txt,!</para>!,!</entry>!,!<entry colsep="0" rowsep="0">!,prcol2B.txt,!</entry>!,!<entry colsep="0" rowsep="0">!,prcolMan.txt,!</entry>!,!<entry colsep="0" rowsep="0">!,prcol4.txt,!</entry>!,!</row>!' placemnt="after" append="1">
</charsubset>
</att>
<att logic="and">
<specval attname="MAND" attloc="" attval="#EQ#\3\">
<specval attname="va_change.txt" attloc="#FOSI" attval="#EQ#\0\">
<fillval attname="supply_id1" attloc="SYSTEM-FUNC" fillcat="savetext" fillchar="conrule">
<charsubset>
<savetext textid="tbody.app" conrule='!<row>!,!<entry colsep="0" rowsep="0">!,!<para>!,\-bb \,prcol3.txt,!</para>!,!</entry>!,!<entry colsep="0" rowsep="0">!,prcol2B.txt,!</entry>!,!<entry colsep="0" rowsep="0">!,prcolMan.txt,!</entry>!,!<entry colsep="0" rowsep="0">!,prcol4.txt,!</entry>!,!</row>!' placemnt="after" append="1">
</charsubset>
</att>

Explication of treat :

when I meet an attribute change=mod on element nomen i place 1 in variable va_change.txt , variable is initialize to 0

If variable = 1 then indicate !<para change="mod">! in string else indicate !<para>!

Problem : information !<para change="mod">! is indicate on nomen yyyyyyyyyyyyyyyy and not on nomen xxxxxxxxxxxxxxxxxxx, as if the variable was seen on the following line

thank you for help

Best regards

pnagai
12-Amethyst
(To:NENESS)

Hi Bruno,

That helps. However, the problem you are working on is one of the trickier aspects of FOSI savetext technique AND I am not experienced with SGML which I think you are working with ... there may be differences from XML that I am not familiar with, so I encourage you, if what I say below does not help, to join the Adepters mailing list where lots and lots of Arbortext users, admins, and developers hang out 24/7/365. Information on joining that list (as well as pointers to lots of other Arbortext resources) can be found here:

http://blog.single-sourcing.com/top-arbortext-resources

See also:

http://www.single-sourcing.com/company/social.html

Ok, so here are three things that might help you. The first is the least likely.

1) You may be having a problem with time dependent vs. time independent text variables. See help for stringdecl to clarify this issue. You can also brute force test things by declaring your text variables as dependent and then independent to see if that helps your problem. For example:

<stringdecl textid="va_change.txt" status="0"> --- time dependent (and default behavior) uses the value true at the time the savetext is created.

<stringdecl textid="va_change.txt" status="1"> --- time independent, uses the last good value encountered. ("Last" is affected by scope. See the help.)

Again, I do not think this is likely to be your problem BUT it can result in the behavior I think you are describing.

2) Instead of creating your row all at once, create it entry by entry. So, if I'm reading your markup correctly, each <nomen> is a cell or <entry>. So try doing a save text for each <nomen> and then in the e-i-c for <supply> build the row.

First nomen savetext (note: you don't HAVE to separate markup from markup with the ! delimiter):

<savetext textid="entry1.app" conrule='!<row><entry colsep="0" rowsep="0"><para change="mod">!,\-aa \,prcol3.txt,!</para></entry>!'placemnt="after" append="0">

Supply savetext:

<savetext textid="tbody.app" conrule='!<row>!,entry1.app,entry2.app,entry3.app,entry4.app,!</row>!' placemnt="after" append="1">

3) And this can be used with idea #2. Save the "change/nochange" value separately from the row OR entry. For example:

<savetext textid="changeornochangepara.app" conrule='!<para change="mod">!' placemnt="after" append="0">

or

<savetext textid="changeornochangepara.app" conrule='!<para>!' placemnt="after" append="0">

And then in the entry (or it could be row) savetext do this:

<savetext textid="entry1.app" conrule='!<row><entry colsep="0" rowsep="0">!,changeornochangepara.app,\-aa \,prcol3.txt,!</para></entry>!'placemnt="after" append="0">

I do this with change bar processing instructions all the time. I save two values:

mysystem_change_bar_start.txt=""

mysystem_change_bar_end.txt=""

Or, if there is change:

mysystem_change_bar_start.txt="<?Pub _touchup?>"

mysystem_change_bar_end.txt="<?Pub /_touchup?>"

Followed by:

mysystemrow=!<para>!,mysystem_change_bar_start.txt,mysystementry1text.txt,mysystem_change_bar_end.txt,!</para>!

(Note that I'm just typing in the general idea now, obviously lots of code and quotes and such to be real FOSI code omitted for clarity.)

Hope one or more of those help! If they don't get you there, you really will need to post this to Adepters. There are much smarter FOSI and SGML masters there who will love the challenge.

Good luck!

Announcements

Top Tags