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

CALS errors checking

Highlighted
Level 1

CALS errors checking

Hi all,

I'm currently working with CALS tables, and I've got a problem with errors checking. I've to do some operations on my tables, which will temporarily suppress the <colspec> tags. But they will be re-written at the end of the operations. I'd like to suspend CALS errors checking at the beginning of my function and to resume at the end. Putting context rules off has no effect. I also unchecked all the warnings types in the display preferences window, but nothing changed. Do you know if it's possible to do it ?

Samuel

Tags (2)
5 REPLIES 5

CALS errors checking

Samuel,

What are you trying to do?  It may be possible to grab the table content, do your process externally then paste the results back into the document.

Lynn

---- Samuel Robinet <-> wrote:
> Hi all,
> I'm currently working with CALS tables, and I've got a problem with errors checking. I've to do some operations on my tables, which will temporarily suppress the <colspec> tags. But they will be re-written at the end of the operations. I'd like to suspend CALS errors checking at the beginning of my function and to resume at the end. Putting context rules off has no effect. I also unchecked all the warnings types in the display preferences window, but nothing changed. Do you know if it's possible to do it ?
> Samuel
>
>      
> ----------     

CALS errors checking

Hello Lynn,

I'll try to be a bit more accurate. The problem is that, when you insert a
column in a CALS table, it will automatically be named
"COLSPEC"+"last_column_nb+1". I will get for example column "COLSPEC4"
between "COLSPEC0" and "COLSPEC1". I need to have colnames in the right
order (COLSPEC0, COLSPEC1, COLSPEC2, ...) to do properly a conversion to
another table format. I use the following code to do it, it works, but I
just need to get rid of errors messages :


oid_xpath_nodeset(oid_current_tag(), $colspecs, "tgroup/colspec")

# calculating new numbers
for ($j = 1; $j <= count($colspecs); $j++) {
$corresp[substr(oid_attr($colspecs[$j], "colname"), 8) + 1] = $j
}

# renumbering colspec
for ($j = 1; $j <= count($colspecs); $j++) {
oid_modify_attr($colspecs[$j], "colname", "COLSPEC"."$co")
}

# renumbering entry
oid_xpath_nodeset(oid_current_tag(), $cells, "*/*/*/entry")
for ($j = 1; $j <= count($cells); $j++) {
$no = substr(oid_attr($cells[$j], "colname"), 8) + 1
$co = $corresp[$no] - 1
oid_modify_attr($cells[$j], "colname", "COLSPEC"."$co")
}

Samuel

2008/5/14 <->:

> Samuel,
>
> What are you trying to do? It may be possible to grab the table content,
> do your process externally then paste the results back into the document.
>
> Lynn
>
> ---- Samuel Robinet <-> wrote:
> > Hi all,
> > I'm currently working with CALS tables, and I've got a problem with
> errors checking. I've to do some operations on my tables, which will
> temporarily suppress the <colspec> tags. But they will be re-written at the
> end of the operations. I'd like to suspend CALS errors checking at the
> beginning of my function and to resume at the end. Putting context rules off
> has no effect. I also unchecked all the warnings types in the display
> preferences window, but nothing changed. Do you know if it's possible to do
> it ?
> > Samuel
> >
> >
>

RE: CALS errors checking

Samuel,



What you are explaining here is something that has been happening since the ADEPT days. When you add a column to any position of a CALS table, the new colname is "COLSPEC?". If you use the colname attribute value for anything that is supposed to be representative of the column position, by adding a column, the column was blown away.



There is a command built into Arbortext that will automatically renumber the colname attributes WITHOUT your intervention in such matters as "error checking" during the process it is the

tbl_model_operation() funciton. With it, you can manipulate your table structure in a number of ways. For your particular needs, you would use the option "2" and the command would look like this:



$x=tbl_model_operation(2, $toid, "COLSPEC%d", 0, 1) ;



There are two ways you can get the "$toid" value.First is tohit every table in the document. The second is to only perform the function on the current table. Either way, the "toid" is the oid of the table element.



To hit every table in the document:

1)Record your current cursor position (so you can return to thestarting point before you punched the key).

2) Go to the begining of the document.

3)Look for a table element.

4) Record its toid.

5) Perform the function on the current table.

6) Repeat until the end of the document.

7) Return to the original cursor position.



The second method is for the current table:

1) Record your current cursor position (so you can return to thestarting point before you punched the key).

2) Goto the parent oid until the oid_name() is "table".

3) Perform the function.

4) Return to the original cursor position.



The "$toid" is the table's oid which can be found by taking the current cursor location (assuming it is in the table). The function is as I mentioned above. The end result is the entire table will be rebuilt with the new "colname" values incremented properly from left to right.



Hope this helps,



Bob

CALS errors checking

Samuel,

I can see the issue, and I really don't know of a way to turn off the error messages.

One thing I noticed in your script though. Do you have any spanned columns? They will need to be modified slightly differently.

Sorry I couldn't help a bit more.

---- Samuel Robinet <-> wrote:
> Hello Lynn,
>
> I'll try to be a bit more accurate. The problem is that, when you insert a
> column in a CALS table, it will automatically be named
> "COLSPEC"+"last_column_nb+1". I will get for example column "COLSPEC4"
> between "COLSPEC0" and "COLSPEC1". I need to have colnames in the right
> order (COLSPEC0, COLSPEC1, COLSPEC2, ...) to do properly a conversion to
> another table format. I use the following code to do it, it works, but I
> just need to get rid of errors messages :
>
>
> oid_xpath_nodeset(oid_current_tag(), $colspecs, "tgroup/colspec")
>
> # calculating new numbers
> for ($j = 1; $j <= count($colspecs); $j++) {
> $corresp[substr(oid_attr($colspecs[$j], "colname"), 8) + 1] = $j
> }
>
> # renumbering colspec
> for ($j = 1; $j <= count($colspecs); $j++) {
> oid_modify_attr($colspecs[$j], "colname", "COLSPEC"."$co")
> }
>
> # renumbering entry
> oid_xpath_nodeset(oid_current_tag(), $cells, "*/*/*/entry")
> for ($j = 1; $j <= count($cells); $j++) {
> $no = substr(oid_attr($cells[$j], "colname"), 8) + 1
> $co = $corresp[$no] - 1
> oid_modify_attr($cells[$j], "colname", "COLSPEC"."$co")
> }
>
> Samuel
>
> 2008/5/14 <->:
>
> > Samuel,
> >
> > What are you trying to do? It may be possible to grab the table content,
> > do your process externally then paste the results back into the document.
> >
> > Lynn
> >
> > ---- Samuel Robinet <-> wrote:
> > > Hi all,
> > > I'm currently working with CALS tables, and I've got a problem with
> > errors checking. I've to do some operations on my tables, which will
> > temporarily suppress the <colspec> tags. But they will be re-written at the
> > end of the operations. I'd like to suspend CALS errors checking at the
> > beginning of my function and to resume at the end. Putting context rules off
> > has no effect. I also unchecked all the warnings types in the display
> > preferences window, but nothing changed. Do you know if it's possible to do
> > it ?
> > > Samuel
> > >
> > >
> >

RE: CALS errors checking

Thank you Bob, I believe that's exactly what I need. For spanned colums, I removed it from the code I posted, but I do the same thing with namest and nameend attributes than with colname. Anyway, thank you all for spending time on my problem.

Have a nice day (or night :-)

Samuel