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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Relative paths in ACL Script

SarahPrice
7-Bedrock

Relative paths in ACL Script

I'm in the process of writing an ACL script that will compose using XSL. The script is working as expected except for the stylesheet selection. I need to be able to set the stylesheet using relative paths but it's not working. Is there a trick to relative paths in Arbortext's ACL?

Here a snippet of the code:

require comp_usingxsl;

require compose;

readvar -TITLE 'IMM Translation'\
-prompt 'Select the Section to Translate:'\
-choice 'Maintenance'\
maint\
-choice 'Illustrated Parts Breakdown'\
ipb\
-choice 'Wiring Diagrams'\
wire\

if ($ipb)
{
$myparams["stylesheet"]="../doctypes/imm/" . "tr_ipc.xsl";
$myparams["outputFile"]="ipc.xml";
}
compose::compose_using_xsl(current_doc(),$myparams);
response("Translation complete.")

Any help would be greatly appreciated. I'm a rookie when it comes to ACL.

Sarah

2 REPLIES 2

I think the problem is that Arbortext doesn't know what the relative
path is relative to. Your best bet is to explicitly supply this,
turning your path into an absolute one.

You could use "dirname(doc_path(current_doc()))" to get the directory
containing the current document or "doc_type_dir(current_doc())" to
get the directory containing the document type of the current
document.

You might also want to try using the "absolute_file_name(filename,
directory)" function to combine a relative filename (possibly
including "..") with a base directory, returning a resolved absolute
filename.

-Brandon 🙂


As always you have saved the day. Thanks Brandon. The doc_type_dir(current_doc()) did the trick.

Sarah
Announcements

Top Tags