template::adp_parse_tags (public)

 template::adp_parse_tags HTML

Defined in packages/acs-templating/tcl/parse-procs.tcl

Parse the tags of the provided HTML text. This function is similar to

template::adp_compile -string $HTML
but it just performs tag substitution, but not ADP variable substitution, since this is done differently in some contextes on the provided HTML chunk. An example for specialized handling is the handling of instance attributes in xowiki.

Parameters:
HTML - text containing potentially ADP tags
Returns:
HTML text with substituted ADP tags

Partial Call Graph (max 5 caller/called nodes):
%3 test_adp_parse_tags adp_parse_tags (test acs-templating) template::adp_parse_tags template::adp_parse_tags test_adp_parse_tags->template::adp_parse_tags ad_log ad_log (public) template::adp_parse_tags->ad_log template::adp_compile_chunk template::adp_compile_chunk (public) template::adp_parse_tags->template::adp_compile_chunk Class ::xowf::test_item::AssessmentInterface Class ::xowf::test_item::AssessmentInterface (public) Class ::xowf::test_item::AssessmentInterface->template::adp_parse_tags adp_parse_ad_conn_file adp_parse_ad_conn_file (private) adp_parse_ad_conn_file->template::adp_parse_tags template::adp_parse_tags_and_localize template::adp_parse_tags_and_localize (private) template::adp_parse_tags_and_localize->template::adp_parse_tags xowf::test_item::AssessmentInterface instproc render_feedback_files xowf::test_item::AssessmentInterface instproc render_feedback_files (public) xowf::test_item::AssessmentInterface instproc render_feedback_files->template::adp_parse_tags xowiki::FormPage instproc www-edit xowiki::FormPage instproc www-edit (public) xowiki::FormPage instproc www-edit->template::adp_parse_tags

Testcases:
adp_parse_tags
Source code:
    #
    #ns_log notice "adp_parse_tags BEGIN [info exists ::template::parse_list]: $HTML"
    if {[string is space $HTML]} {
        return $HTML
    }
    set old_parse_list [expr {[info exists ::template::parse_list] ? $::template::parse_list : ""}]
    set ::template::parse_list ""
    #
    # The following exception handler is just for safety to achieve a
    # high-level of backward compatibility. In case
    # "adp_compile_chunk" and or the evaluation of the resulting code
    # fails, fall back to the original behavior without ADP tag
    # substitution.
    #
    try {
        template::adp_compile_chunk $HTML
        lappend ::template::parse_list {set __adp_output}
        #ns_log notice "adp_parse_tags parse list '[join $::template::parse_list \n]'"
        set HTML [eval [join $::template::parse_list \n]]
    } on error {errorMsg} {
        ad_log warning "adp_parse_tags failed on parsing:\n'$HTML'"
    }
    set ::template::parse_list $old_parse_list
    #ns_log notice "adp_parse_tags END: $HTML"
    return $HTML
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: