tDOM

Check-in [4cc96fcd33]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Fixed bug (invalid mem access) if a virtual constraint will be called under certain circumstances while looking if pcdata matches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | schema
Files: files | file ages | folders
SHA3-256: 4cc96fcd33f32266ad72495e27b68c8d84604773559f4ef4fea4940aa3f5fbfe
User & Date: rolf 2019-05-10 13:40:50
Context
2019-05-14
20:02
Enhanced the text constraint commands id/idref: Beside the one doc wide ID space there are now additional other named doc wide ID/IDREF spaces possible. Each of them work along the unnamed doc wide ID space. check-in: 6b550b98f8 user: rolf tags: schema
2019-05-10
13:41
Merge from schema. check-in: 4bf39f2571 user: rolf tags: localkey
13:40
Fixed bug (invalid mem access) if a virtual constraint will be called under certain circumstances while looking if pcdata matches. check-in: 4cc96fcd33 user: rolf tags: schema
13:04
Futher work on prefixns: allow it als top level command in define script. Changed semantic to first prefix/namespace mapping in prefixUriList wins, if there are several prefixes mapping to different namespaces. check-in: a70c1d6c6e user: rolf tags: schema
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/schema.c.

  1693   1693                       if (mustMatch (cp->quants[ac], hm)) {
  1694   1694                           SetResult ("Unexpected text content");
  1695   1695                           return 0;
  1696   1696                       }
  1697   1697                       break;
  1698   1698   
  1699   1699                   case SCHEMA_CTYPE_VIRTUAL:
  1700         -                    if (!evalVirtual (interp, sdata, ic)) return 0;
         1700  +                    if (!evalVirtual (interp, sdata, candidate)) return 0;
  1701   1701                       break;
  1702   1702                       
  1703   1703                   case SCHEMA_CTYPE_NAME:
  1704   1704                   case SCHEMA_CTYPE_ANY:
  1705   1705                       if (mustMatch (cp->quants[ac], hm)) {
  1706   1706                           SetResult ("Unexpected text content");
  1707   1707                           return 0;

Changes to tests/schema.test.

  3864   3864       }
  3865   3865       set schema-15.3 ""
  3866   3866       set result [s validate {<doc><a><b>foo</b><c/></a><a><b></b><c>bar</c></a></doc>} msg]
  3867   3867       s delete
  3868   3868       lappend result $msg {*}${schema-15.3}
  3869   3869       set result
  3870   3870   } {1 {} astart a aend a astart a aend a}
         3871  +
         3872  +proc schema-15.4 {text cmd} {
         3873  +    if {$text ne "in docContent"} {error "unexpected text argument"}
         3874  +    set ::schema-15.4 [$cmd info stack inside]
         3875  +}
         3876  +test schema-15.4 {constraint cmd tcl} {
         3877  +    tdom::schema s
         3878  +    s define {
         3879  +        defelement doc {
         3880  +            ref docContent
         3881  +        }
         3882  +        defpattern docContent {
         3883  +            element a
         3884  +            tcl schema-15.4 "in docContent"
         3885  +            text
         3886  +            element b
         3887  +        }
         3888  +    }
         3889  +    set schema-15.4 ""
         3890  +    set result [s validate {<doc><a/>foo<b/></doc>}]
         3891  +    s delete
         3892  +    lappend result [set schema-15.4]
         3893  +    set result
         3894  +} {1 doc}
  3871   3895   
  3872   3896   test schema-16.1 {interleave} {
  3873   3897       tdom::schema s
  3874   3898       s define {
  3875   3899           defelement doc {
  3876   3900               interleave {
  3877   3901                   element a