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

Overview
Comment:Scripted XPath functions in domunique/domxpathboolean XPath expression crashes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | schema
Files: files | file ages | folders
SHA3-256: ad809ed8984c1691eff3afc9d367b0f2c51167b0a707a26eb8d52d2a9f307b62
User & Date: rolf 2020-05-30 01:04:19
Context
2020-05-30
01:38
Scripted XPath functions now also work in domunique/domxpathboolean XPath expression arguments. check-in: 6c38650608 user: rolf tags: schema
01:04
Scripted XPath functions in domunique/domxpathboolean XPath expression crashes. check-in: ad809ed898 user: rolf tags: schema
2020-05-27
00:34
Integrated bug fix branch: Handling of not per quantifier but per all childs optional content particle. check-in: 32945e114c user: rolf tags: schema
Changes

Changes to tests/schema.test.

9270
9271
9272
9273
9274
9275
9276


























9277
9278
9279
9280
9281
9282
9283
} {1 {Error in selector xpath: 'NodeTest: Expected "WCARDNAME" for 'a + + b' 

Parsed symbols:
     0 WCARDNAME        0 000000000     0  a
     1 PLUS             0 000000000     2  
     2 PLUS             0 000000000     4  
     3 WCARDNAME        0 000000000     6  b}}



























proc schema-26.1 {scmd} {
    lappend ::result "fromtcl: [[$scmd info domNode] nodeName]"
}

test schema-26.1 {info domNode} {
    tdom::schema s







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
} {1 {Error in selector xpath: 'NodeTest: Expected "WCARDNAME" for 'a + + b' 

Parsed symbols:
     0 WCARDNAME        0 000000000     0  a
     1 PLUS             0 000000000     2  
     2 PLUS             0 000000000     4  
     3 WCARDNAME        0 000000000     6  b}}

proc ::dom::xpathFunc::compare {ctxNode pos nodeListType nodeList args} {
    if {[llength $args] != 4} {
        error "XPath function date: Expected two arguments but got
               [expr {[llength $args] / 2}]"
    }
    lassign $args arg1Typ arg1Value arg2Typ arg2Value
    set arg1 [::dom::xpathFuncHelper::coerce2string $arg1Typ $arg1Value]
    set arg2 [::dom::xpathFuncHelper::coerce2string $arg2Typ $arg2Value]
    return [list number [string compare $arg1 $arg2]]
}

test schema-25.6 {domxpathboolean - scripted XPath function} {
    tdom::schema s
    s define {
        defelement doc {
            element a ! {
                text
                domxpathboolean {compare('foo','bar') < 0} first
                domxpathboolean {compare('foo','bar') > 0} second
            }
        }
    }
    set doc [dom parse {<doc><a>2020-07-30</a></doc>}]
    set result [s domvalidate $doc error]
} {0}

proc schema-26.1 {scmd} {
    lappend ::result "fromtcl: [[$scmd info domNode] nodeName]"
}

test schema-26.1 {info domNode} {
    tdom::schema s