apm::package_version::attributes::parse_xml (private)

 apm::package_version::attributes::parse_xml -parent_node parent_node \
    -array array

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

Given the parent node in an XML tree parse the package version attributes and set their values with upvar in the array with given name.

Switches:
-parent_node (required)
A reference to the parent XML node of the attribute nodes
-array (required)
The name of the array in the callers scope to set the attribute values in.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 apm_get_package_repository apm_get_package_repository (public) apm::package_version::attributes::parse_xml apm::package_version::attributes::parse_xml apm_get_package_repository->apm::package_version::attributes::parse_xml apm_read_package_info_file apm_read_package_info_file (public) apm_read_package_info_file->apm::package_version::attributes::parse_xml apm::package_version::attributes::default_value apm::package_version::attributes::default_value (public) apm::package_version::attributes::parse_xml->apm::package_version::attributes::default_value apm::package_version::attributes::get_spec apm::package_version::attributes::get_spec (public) apm::package_version::attributes::parse_xml->apm::package_version::attributes::get_spec xml_node_get_content xml_node_get_content (public) apm::package_version::attributes::parse_xml->xml_node_get_content xml_node_get_first_child_by_name xml_node_get_first_child_by_name (public) apm::package_version::attributes::parse_xml->xml_node_get_first_child_by_name

Testcases:
No testcase defined.
Source code:
    upvar $array attributes

    array set dynamic_attributes [apm::package_version::attributes::get_spec]
    foreach attribute_name [array names dynamic_attributes] {
        set attribute_node [xml_node_get_first_child_by_name $parent_node $attribute_name]

        if { $attribute_node ne "" } {
            # There is a tag for the attribute so use the tag contents
            set attributes($attribute_name) [xml_node_get_content $attribute_node]
        } else {
            # No tag for the attribute - use default value
            set attributes($attribute_name) [apm::package_version::attributes::default_value $attribute_name]
        }
    }
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: