Skip to main content
10-Marble
January 3, 2011
Question

Relative paths in ACL Script

  • January 3, 2011
  • 2 replies
  • 857 views

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

    1-Visitor
    January 3, 2011
    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 🙂


    10-Marble
    January 3, 2011
    As always you have saved the day. Thanks Brandon. The doc_type_dir(current_doc()) did the trick.

    Sarah