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

Calling a file from ACL

Newbie

Calling a file from ACL

I have an interesting question. I've written a relatively small ACL script
that will go out, read an attribute value on a specific element and set this
as a document baseline. The script then traverses the document comparing
the baseline value with that set in other elements. Any disparities are fed
through an eval statement to a file. The file is named from a variable that
has been truncated from the $DOCNAME variable.

Here's the problem. When I run this script against multiple documents (one
after the other), the output file is always one document behind the current
file. If I send any of the disparities to an EVAL window, the script runs
properly.

I am including the ACL file. The DTD I am using is based on the
MIL-STD-38784 DTD (you could run this script on it as the script is only
looking for the element IDINFO and the attribute 'security').

What the script is supposed to do it
1. capture the name of the current file
2. crop the dot extension
3. clear any previous files with the current file name with a dot txt
extension.
4. Run through the document doing the comparison
5. Record for output any disparities to the file
6. At the end of the document, open the error file in Wordpad

What really happens
1. the file name is captured
2. the dot sgm extension is cropped
3. when the Windows dialog box appears asking to overwrite the file,
the filename is not the current file, but the name of the last document
checked.
4. The document is traversed
5. potential errors are reported
6. the file opens with the current file name but the previous files
errors.

If I change the output to go to the eval window rather than a file,
everything works right. I've added some eval statements to see if the
docname was being lost, it isn't. A couple of our programmers have looked
at the code and agree that it looks like it should work. Any help would be
appreciated.

Thanks,

Lynn E. Hales
Information Systems Specialist
AMSEC-LLC
Phone (757)896-5466
Email: Lynn_Hales@AMSEC.com
Tags (2)
2 REPLIES 2
Highlighted

Calling a file from ACL

Highlighted

Calling a file from ACL

At 01:11 PM 8/23/1999 -0400, Hales, Lynn wrote:
>Paul,
>
>Thanks for the input. I tried the idname=basename(doc_path(current_doc()))
>this afternoon (right afte I put out a couple of other fires). The results
>were the same.
>
>I also commented out the goto_oid() and found out why I was using it. For
>some reason, if I don't move the cursor, when I check the security value for
>my baseline, it doesn't get read properly.

This is because the oid for idinfo is referenced using oid_current_tag(),
which is base on cursor position, instead of your variable "o", which
is the OID being referenced in your oid_forward() traversal. If you replace
oid_current_tag() with o, you can stop moving the cursor.
Announcements