Check-in [f041a75d3a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor spelling fix
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:f041a75d3a835a11e46bace03c0f112ed150b9b711ce63b5d28a12c3a0f6ead1
User & Date: andy 2018-07-20 15:17:29
Context
2018-07-20 15:21
Debug log spelling check-in: dd05a23974 user: andy tags: trunk
2018-07-20 15:17
Minor spelling fix check-in: f041a75d3a user: andy tags: trunk
2018-06-13 07:57
Change version numbers of changed files to 2.6.0 check-in: fc8e965f20 user: oehhar tags: trunk, Release_2.6.0
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Utilities.tcl.

310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
....
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
....
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
....
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
....
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
....
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
....
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
....
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
....
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
....
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
....
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
        return [array get options]
    } elseif {[llength $args] == 1} {
        set opt [lindex $args 0]
        ::log::logsubst debug {One Option {$opt}}
        if {[info exists options($opt)]} {
            return $options($opt)
        } else {
            ::log::logsubst debug {Unkown option {$opt}}
            return \
                -code error \
                -errorcode [list WS CLIENT UNKOPTION $opt] \
                "Unknown option'$opt'"
        }
    } elseif {([llength $args] % 2) == 0} {
        ::log::log debug {Multiple option pairs}
        foreach {opt value} $args {
            if {[info exists options($opt)]} {
                ::log::logsubst debug {Setting Option {$opt} to {$value}}
                set options($opt) $value
            } else {
                ::log::logsubst debug {Unkown option {$opt}}
                return \
                    -code error \
                    -errorcode [list WS CLIENT UNKOPTION $opt] \
                    "Unknown option'$opt'"
            }
        }
    } else {
................................................................................
    ::log::logsubst debug {Entering [info level 0]}

    upvar 1 $tnsCountVar tnsCount
    upvar 1 $serviceInfoVar serviceInfo
    variable currentSchema
    variable nsList
    variable options
    variable unkownRef

    set currentSchema $schemaNode
    set tmpTargetNs $::WS::Utils::targetNs
    foreach attr [$schemaNode attributes] {
        set value {?}
        catch {set value [$schemaNode getAttribute $attr]}
        ::log::logsubst debug {Attribute $attr = $value}
................................................................................
    }

    ##
    ## Process the scheme in multiple passes to handle forward references and extensions
    ##
    set pass 1
    set lastUnknownRefCount 0
    array unset unkownRef
    while {($pass == 1) || ($lastUnknownRefCount != [array size unkownRef])} {
        ::log::logsubst debug  {Pass $pass over schema}
        incr pass
        set lastUnknownRefCount [array size unkownRef]
        array unset unkownRef

        foreach element [$schemaNode selectNodes -namespaces $nsList xs:import] {
            if {[catch {processImport $mode $baseUrl $element $serviceName serviceInfo tnsCount} msg]} {
                ::log::logsubst notice {Import failed due to: {$msg}.  Trace: $::errorInfo}
            }
        }

................................................................................
            ::log::logsubst debug {\tprocessing $element}
            if {[catch {parseComplexType $mode serviceInfo $serviceName $element $tns} msg]} {
                ::log::logsubst notice {Unhandled error: {$msg}.  Trace: $::errorInfo}
            }
        }
    }

    set lastUnknownRefCount [array size unkownRef]
    foreach {unkRef usedByTypeList} [array get unkownRef] {
        foreach usedByType $usedByTypeList {
            switch -exact -- $options(StrictMode) {
                debug -
                warning {
                    ::log::logsubst $options(StrictMode) {Unknown type reference $unkRef in type $usedByType}
                }
                error -
................................................................................
    }

    if {$lastUnknownRefCount} {
        switch -exact -- $options(StrictMode) {
            debug -
            warning {
                set ::WS::Utils::targetNs $tmpTargetNs
                ::log::logsubst $options(StrictMode) {Found $lastUnknownRefCount forward type references: [join [array names unkownRef] {,}]}
            }
            error -
            default {
                set ::WS::Utils::targetNs $tmpTargetNs
                return \
                    -code error \
                    -errorcode [list WS $mode UNKREFS [list $lastUnknownRefCount]] \
                    "Found $lastUnknownRefCount forward type references: [join [array names unkownRef] {,}]"
            }
        }
    }



    ##
................................................................................
#
#
###########################################################################
proc ::WS::Utils::parseComplexType {mode dictVar serviceName node tns} {
    upvar 1 $dictVar results
    variable currentSchema
    variable nsList
    variable unkownRef
    variable defaultType

    ::log::logsubst debug {Entering [info level 0]}

    set isAbstractType false
    set defaultType string
    set typeName $tns:[$node getAttribute name]
................................................................................
                                ##
                                set partName [lindex [dict keys $refTypeInfo] 0]
                            }
                            set partType [getQualifiedType $results [dict get $refTypeInfo $partName type] $tns]
                        }
                        lappend partList $partName [list type $partType]
                    }]} {
                        lappend unkownRef($partType) $typeName
                        return \
                            -code error \
                            -errorcode [list WS $mode UNKREF [list $typeName $partType]] \
                            "Unknown forward type reference {$partType} in {$typeName}"
                    }
                } else {
                    set partName [$middleNode getAttribute name]
................................................................................
# -------  ----------  ----------   -------------------------------------------
#       1  07/06/2006  G.Lester     Initial version
#
#
###########################################################################
proc ::WS::Utils::partList {mode node serviceName dictVar tns {occurs {}}} {
    variable currentSchema
    variable unkownRef
    variable nsList
    variable defaultType
    variable options
    variable simpleTypes
    upvar 1 $dictVar results

    set partList {}
................................................................................
                        }
                    }
                }
                set baseInfo [GetServiceTypeDef $mode $serviceName $baseName]
                ::log::logsubst debug {\t baseInfo is {$baseInfo}}
                if {[llength $baseInfo] == 0} {
                    ::log::logsubst debug {\t Unknown reference '$baseName'}
                    set unkownRef($baseName) 1
                    return;
                }
                catch {set partList [concat $partList [dict get $baseInfo definition]]}
            } else {
                ::log::logsubst debug {\t Simple type}
            }
            foreach elementNode [$node childNodes] {
................................................................................
#
###########################################################################
proc ::WS::Utils::parseElementalType {mode dictVar serviceName node tns} {

    upvar 1 $dictVar results
    variable importedXref
    variable nsList
    variable unkownRef

    ::log::logsubst debug {Entering [info level 0]}

    set attributeName name
    if {![$node hasAttribute $attributeName]} {
        set attributeName ref
    }
................................................................................
                        ##
                        ## Not a simple element, so point type to type of same name as element
                        ##
                        set partType [getQualifiedType $results $partName $tns]
                    }
                }
            } msg]} {
                lappend unkownRef($partType) $typeName
                log::logsubst debug {Unknown ref {$partType,$typeName} error: {$msg} trace: $::errorInfo}
                return \
                    -code error \
                    -errorcode [list WS $mode UNKREF [list $typeName $partType]] \
                    "Unknown forward type reference {$partType} in {$typeName}"
            }
        } else {







|












|







 







|







 







|
|


|
|







 







|
|







 







|







|







 







|







 







|







 







|







 







|







 







|







 







|







310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
....
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
....
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
....
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
....
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
....
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
....
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
....
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
....
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
....
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
....
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
        return [array get options]
    } elseif {[llength $args] == 1} {
        set opt [lindex $args 0]
        ::log::logsubst debug {One Option {$opt}}
        if {[info exists options($opt)]} {
            return $options($opt)
        } else {
            ::log::logsubst debug {Unknown option {$opt}}
            return \
                -code error \
                -errorcode [list WS CLIENT UNKOPTION $opt] \
                "Unknown option'$opt'"
        }
    } elseif {([llength $args] % 2) == 0} {
        ::log::log debug {Multiple option pairs}
        foreach {opt value} $args {
            if {[info exists options($opt)]} {
                ::log::logsubst debug {Setting Option {$opt} to {$value}}
                set options($opt) $value
            } else {
                ::log::logsubst debug {Unknown option {$opt}}
                return \
                    -code error \
                    -errorcode [list WS CLIENT UNKOPTION $opt] \
                    "Unknown option'$opt'"
            }
        }
    } else {
................................................................................
    ::log::logsubst debug {Entering [info level 0]}

    upvar 1 $tnsCountVar tnsCount
    upvar 1 $serviceInfoVar serviceInfo
    variable currentSchema
    variable nsList
    variable options
    variable unknownRef

    set currentSchema $schemaNode
    set tmpTargetNs $::WS::Utils::targetNs
    foreach attr [$schemaNode attributes] {
        set value {?}
        catch {set value [$schemaNode getAttribute $attr]}
        ::log::logsubst debug {Attribute $attr = $value}
................................................................................
    }

    ##
    ## Process the scheme in multiple passes to handle forward references and extensions
    ##
    set pass 1
    set lastUnknownRefCount 0
    array unset unknownRef
    while {($pass == 1) || ($lastUnknownRefCount != [array size unknownRef])} {
        ::log::logsubst debug  {Pass $pass over schema}
        incr pass
        set lastUnknownRefCount [array size unknownRef]
        array unset unknownRef

        foreach element [$schemaNode selectNodes -namespaces $nsList xs:import] {
            if {[catch {processImport $mode $baseUrl $element $serviceName serviceInfo tnsCount} msg]} {
                ::log::logsubst notice {Import failed due to: {$msg}.  Trace: $::errorInfo}
            }
        }

................................................................................
            ::log::logsubst debug {\tprocessing $element}
            if {[catch {parseComplexType $mode serviceInfo $serviceName $element $tns} msg]} {
                ::log::logsubst notice {Unhandled error: {$msg}.  Trace: $::errorInfo}
            }
        }
    }

    set lastUnknownRefCount [array size unknownRef]
    foreach {unkRef usedByTypeList} [array get unknownRef] {
        foreach usedByType $usedByTypeList {
            switch -exact -- $options(StrictMode) {
                debug -
                warning {
                    ::log::logsubst $options(StrictMode) {Unknown type reference $unkRef in type $usedByType}
                }
                error -
................................................................................
    }

    if {$lastUnknownRefCount} {
        switch -exact -- $options(StrictMode) {
            debug -
            warning {
                set ::WS::Utils::targetNs $tmpTargetNs
                ::log::logsubst $options(StrictMode) {Found $lastUnknownRefCount forward type references: [join [array names unknownRef] {,}]}
            }
            error -
            default {
                set ::WS::Utils::targetNs $tmpTargetNs
                return \
                    -code error \
                    -errorcode [list WS $mode UNKREFS [list $lastUnknownRefCount]] \
                    "Found $lastUnknownRefCount forward type references: [join [array names unknownRef] {,}]"
            }
        }
    }



    ##
................................................................................
#
#
###########################################################################
proc ::WS::Utils::parseComplexType {mode dictVar serviceName node tns} {
    upvar 1 $dictVar results
    variable currentSchema
    variable nsList
    variable unknownRef
    variable defaultType

    ::log::logsubst debug {Entering [info level 0]}

    set isAbstractType false
    set defaultType string
    set typeName $tns:[$node getAttribute name]
................................................................................
                                ##
                                set partName [lindex [dict keys $refTypeInfo] 0]
                            }
                            set partType [getQualifiedType $results [dict get $refTypeInfo $partName type] $tns]
                        }
                        lappend partList $partName [list type $partType]
                    }]} {
                        lappend unknownRef($partType) $typeName
                        return \
                            -code error \
                            -errorcode [list WS $mode UNKREF [list $typeName $partType]] \
                            "Unknown forward type reference {$partType} in {$typeName}"
                    }
                } else {
                    set partName [$middleNode getAttribute name]
................................................................................
# -------  ----------  ----------   -------------------------------------------
#       1  07/06/2006  G.Lester     Initial version
#
#
###########################################################################
proc ::WS::Utils::partList {mode node serviceName dictVar tns {occurs {}}} {
    variable currentSchema
    variable unknownRef
    variable nsList
    variable defaultType
    variable options
    variable simpleTypes
    upvar 1 $dictVar results

    set partList {}
................................................................................
                        }
                    }
                }
                set baseInfo [GetServiceTypeDef $mode $serviceName $baseName]
                ::log::logsubst debug {\t baseInfo is {$baseInfo}}
                if {[llength $baseInfo] == 0} {
                    ::log::logsubst debug {\t Unknown reference '$baseName'}
                    set unknownRef($baseName) 1
                    return;
                }
                catch {set partList [concat $partList [dict get $baseInfo definition]]}
            } else {
                ::log::logsubst debug {\t Simple type}
            }
            foreach elementNode [$node childNodes] {
................................................................................
#
###########################################################################
proc ::WS::Utils::parseElementalType {mode dictVar serviceName node tns} {

    upvar 1 $dictVar results
    variable importedXref
    variable nsList
    variable unknownRef

    ::log::logsubst debug {Entering [info level 0]}

    set attributeName name
    if {![$node hasAttribute $attributeName]} {
        set attributeName ref
    }
................................................................................
                        ##
                        ## Not a simple element, so point type to type of same name as element
                        ##
                        set partType [getQualifiedType $results $partName $tns]
                    }
                }
            } msg]} {
                lappend unknownRef($partType) $typeName
                log::logsubst debug {Unknown ref {$partType,$typeName} error: {$msg} trace: $::errorInfo}
                return \
                    -code error \
                    -errorcode [list WS $mode UNKREF [list $typeName $partType]] \
                    "Unknown forward type reference {$partType} in {$typeName}"
            }
        } else {