apm_load_install_xml (private)

 apm_load_install_xml filename binds

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Loads an install file and returns the root node. errors out if the file is not there. substitutes variables before parsing so you can provide interpolated values.

Parameters:
filename (required)
relative to serverroot, leading slash needed.
binds (required)
list of {variable value variable value ...}
Returns:
root_node of the parsed XML file.
Author:
Jeff Davis davis@xarg.net
Created:
2003-10-30

Partial Call Graph (max 5 caller/called nodes):
%3 apm::process_install_xml apm::process_install_xml (public) apm_load_install_xml apm_load_install_xml apm::process_install_xml->apm_load_install_xml ad_file ad_file (public) apm_load_install_xml->ad_file xml_doc_get_first_node xml_doc_get_first_node (public) apm_load_install_xml->xml_doc_get_first_node xml_parse xml_parse (public) apm_load_install_xml->xml_parse

Testcases:
No testcase defined.
Source code:
    # Abort if there is no install.xml file
    set filename $::acs::rootdir$filename

    if { ![ad_file exists $filename] } {
        error "File $filename not found"
    }

    # Read the whole file
    set file [open $filename]
    set __the_body__ [read $file]
    close $file
    # Interpolate the vars.
    if {$binds ne ""} {
        foreach {var val} $binds {
            set $var [ns_quotehtml $val]
        }
        if {![info exists Id]} {
            set Id {$Id}
        }
        if {[catch {set __the_body__ [subst -nobackslashes -nocommands ${__the_body__}]} err]} {
            error $err
        }
    }

    set root_node [xml_doc_get_first_node [xml_parse -persist ${__the_body__}]]
    return $root_node
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: