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

Overview
Comment:wip
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip
Files: files | file ages | folders
SHA3-256: eab0bfc95bb327032e307967c3dd62195d4be44261ce60684ba54397c55c1b80
User & Date: rolf 2024-07-06 13:59:04
Context
2024-07-07
00:03
wip check-in: 8da21506ea user: rolf tags: wip
2024-07-06
13:59
wip check-in: eab0bfc95b user: rolf tags: wip
13:01
wip check-in: d5a6827d04 user: rolf tags: wip
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/domhtml.c.

2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
....
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
    int          ignoreWhiteSpaces,
    int          forest,
    char       **errStr
) {
    register int   c;          /* Next character of the input file */
    register char *pn, *e;
    register char *x, *start, *piSep;
    int            saved;
    int            hasContent;
    domNode       *pnode;
    domNode       *node = NULL, *parent_node = parent;
    domTextNode   *tnode;
    domAttrNode   *attrnode, *lastAttr;
    int            ampersandSeen = 0;
    int            only_whites   = 0;
................................................................................
            }
            /*-----------------------------------------------------------
            |   read attribute name-value pairs
            \----------------------------------------------------------*/
            lastAttr = NULL;
            while ( (c=*x) && (c!='/') && (c!='>') && (c!='<') ) {
                char *ArgName = x;
                int nArgName;
                char *ArgVal = NULL;
                int nArgVal = 0;

                while ((c=*x)!=0 && c!='=' && c!='>' && !SPACE(c) ) {
                    *x = tolower(c);
                    x++;
                }
                nArgName = x - ArgName;
                while (SPACE(*x)) {







|







 







|

|







2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
....
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
    int          ignoreWhiteSpaces,
    int          forest,
    char       **errStr
) {
    register int   c;          /* Next character of the input file */
    register char *pn, *e;
    register char *x, *start, *piSep;
    char           savedChar;
    int            hasContent;
    domNode       *pnode;
    domNode       *node = NULL, *parent_node = parent;
    domTextNode   *tnode;
    domAttrNode   *attrnode, *lastAttr;
    int            ampersandSeen = 0;
    int            only_whites   = 0;
................................................................................
            }
            /*-----------------------------------------------------------
            |   read attribute name-value pairs
            \----------------------------------------------------------*/
            lastAttr = NULL;
            while ( (c=*x) && (c!='/') && (c!='>') && (c!='<') ) {
                char *ArgName = x;
                domLength nArgName;
                char *ArgVal = NULL;
                domLength nArgVal = 0;

                while ((c=*x)!=0 && c!='=' && c!='>' && !SPACE(c) ) {
                    *x = tolower(c);
                    x++;
                }
                nArgName = x - ArgName;
                while (SPACE(*x)) {

Changes to generic/domxpath.c.

2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
....
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897

5898
5899
5900
5901
5902
5903
5904
5905
5906
        newlen = strlen(xpath);
        *errMsg = (char*)REALLOC(*errMsg, len+newlen+10);
        memmove(*errMsg + len, " for '", 6);
        memmove(*errMsg + len+6, xpath, newlen);
        memmove(*errMsg + len+6+newlen, "' ", 3);

        for (i=0; tokens[i].token != EOS; i++) {
            sprintf(tmp, "%s\n%3s%3d %-12s %5ld %09.3g %5d  ",
                         (i==0) ? "\n\nParsed symbols:" : "",
                         (i==l) ? "-->" : "   ",
                          i,
                         token2str[tokens[i].token-LPAR],
                         tokens[i].intvalue,
                         tokens[i].realvalue,
                         tokens[i].pos
................................................................................


/*----------------------------------------------------------------------------
|   nodeToXPath  -  returns a XPath addressing exactly the given node
|
\---------------------------------------------------------------------------*/
static void nodeToXPath (
    domNode  * node,
    char    ** xpath,
    int      * xpathLen,
    int      * xpathAllocated,
    int        legacy
)
{
    domNode *parent, *child;
    char    step[200], *nTest;

    int     sameNodes, nodeIndex, len;


    parent = node->parentNode;
    if (parent == NULL) {
        parent = node->ownerDocument->rootNode;
    } else {
        nodeToXPath (parent, xpath, xpathLen, xpathAllocated, legacy);
    }







|







 







|
|
|
|
|




>
|
<







2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
....
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899

5900
5901
5902
5903
5904
5905
5906
        newlen = strlen(xpath);
        *errMsg = (char*)REALLOC(*errMsg, len+newlen+10);
        memmove(*errMsg + len, " for '", 6);
        memmove(*errMsg + len+6, xpath, newlen);
        memmove(*errMsg + len+6+newlen, "' ", 3);

        for (i=0; tokens[i].token != EOS; i++) {
            sprintf(tmp, "%s\n%3s%3d %-12s %5ld %09.3g %5ld  ",
                         (i==0) ? "\n\nParsed symbols:" : "",
                         (i==l) ? "-->" : "   ",
                          i,
                         token2str[tokens[i].token-LPAR],
                         tokens[i].intvalue,
                         tokens[i].realvalue,
                         tokens[i].pos
................................................................................


/*----------------------------------------------------------------------------
|   nodeToXPath  -  returns a XPath addressing exactly the given node
|
\---------------------------------------------------------------------------*/
static void nodeToXPath (
    domNode   * node,
    char     ** xpath,
    domLength * xpathLen,
    domLength * xpathAllocated,
    int         legacy
)
{
    domNode *parent, *child;
    char    step[200], *nTest;
    size_t  len;
    int     sameNodes, nodeIndex;


    parent = node->parentNode;
    if (parent == NULL) {
        parent = node->ownerDocument->rootNode;
    } else {
        nodeToXPath (parent, xpath, xpathLen, xpathAllocated, legacy);
    }

Changes to generic/domxpath.h.

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

} xpathResultSet;

typedef xpathResultSet *xpathResultSets;

typedef int (*xpathFuncCallback) 
                (void *clientData, char *functionName, 
                 domNode *ctxNode, int position, xpathResultSet *nodeList,
                 domNode *exprContext, int argc, xpathResultSets *args,
                 xpathResultSet *result, char  **errMsg);
                              
typedef int (*xpathVarCallback) 
                (void *clientData, char *variableName, char *varURI,
                 xpathResultSet *result, char  **errMsg);
                              







|







124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

} xpathResultSet;

typedef xpathResultSet *xpathResultSets;

typedef int (*xpathFuncCallback) 
                (void *clientData, char *functionName, 
                 domNode *ctxNode, domLength position, xpathResultSet *nodeList,
                 domNode *exprContext, int argc, xpathResultSets *args,
                 xpathResultSet *result, char  **errMsg);
                              
typedef int (*xpathVarCallback) 
                (void *clientData, char *variableName, char *varURI,
                 xpathResultSet *result, char  **errMsg);
                              

Changes to generic/domxslt.c.

917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
....
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
....
5510
5511
5512
5513
5514
5515
5516

5517
5518
5519
5520
5521
5522
5523
5524
/*----------------------------------------------------------------------------
|   formatValue
|
\---------------------------------------------------------------------------*/
static void formatValue (
    xsltNumberFormat *f,
    int              *useFormatToken,
    int               value,
    Tcl_DString      *str,
    char             *groupingSeparator,
    long              groupingSize,
    int               addSeparater
)
{
    size_t      len, fulllen, gslen;
    int         upper = 0, e, m, b, i, z, v;
    char        tmp[80], *pt;
    Tcl_DString tmp1;
    static struct { char *digit; char *ldigit; int value; } RomanDigit[] = {
          { "M" , "m" , 1000, },
          { "CM", "cm",  900, },
          { "D" , "d" ,  500, },
          { "CD", "cd",  400, },
................................................................................
    domNode         * currentNode,
    domLength         currentPos,
    domNode         * actionNode,
    char           ** errMsg
)
{
    xpathResultSet    rs;
    int               rc, NaN, hnew, i, useFormatToken, vVals = 0;
    domLength         vs[20], *v, *vd = NULL;
    long              groupingSize = 0;
    char             *value, *level, *count, *from, *str, *str1, *format;
    char             *groupingSeparator = NULL, *groupingSizeStr = NULL;
    char             *tail;
    ast               t_count, t_from;
    domNode          *node, *start;
    Tcl_HashEntry    *h;
................................................................................
|
\---------------------------------------------------------------------------*/
static void StripXSLTSpace (
    domNode    * node
)
{
    domNode *child, *newChild, *parent;

    int     i, len, onlySpace;
    char   *p;

    if (node->nodeType == TEXT_NODE) {
        node->info = (int)unknown;
        p = ((domTextNode*)node)->nodeValue;
        len = ((domTextNode*)node)->valueLength;
        onlySpace = 1;







|






|
|







 







|
|







 







>
|







917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
....
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
....
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
/*----------------------------------------------------------------------------
|   formatValue
|
\---------------------------------------------------------------------------*/
static void formatValue (
    xsltNumberFormat *f,
    int              *useFormatToken,
    domLength         value,
    Tcl_DString      *str,
    char             *groupingSeparator,
    long              groupingSize,
    int               addSeparater
)
{
    size_t      len, fulllen, gslen, m, i;
    int         upper = 0, e, b, z, v;
    char        tmp[80], *pt;
    Tcl_DString tmp1;
    static struct { char *digit; char *ldigit; int value; } RomanDigit[] = {
          { "M" , "m" , 1000, },
          { "CM", "cm",  900, },
          { "D" , "d" ,  500, },
          { "CD", "cd",  400, },
................................................................................
    domNode         * currentNode,
    domLength         currentPos,
    domNode         * actionNode,
    char           ** errMsg
)
{
    xpathResultSet    rs;
    int               rc, NaN, hnew, i, useFormatToken;
    domLength         vs[20], *v, *vd = NULL, vVals = 0;
    long              groupingSize = 0;
    char             *value, *level, *count, *from, *str, *str1, *format;
    char             *groupingSeparator = NULL, *groupingSizeStr = NULL;
    char             *tail;
    ast               t_count, t_from;
    domNode          *node, *start;
    Tcl_HashEntry    *h;
................................................................................
|
\---------------------------------------------------------------------------*/
static void StripXSLTSpace (
    domNode    * node
)
{
    domNode *child, *newChild, *parent;
    domLength i, len;
    int onlySpace;
    char   *p;

    if (node->nodeType == TEXT_NODE) {
        node->info = (int)unknown;
        p = ((domTextNode*)node)->nodeValue;
        len = ((domTextNode*)node)->valueLength;
        onlySpace = 1;

Changes to generic/schema.c.

5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
            Tcl_ResetResult (interp);
            Tcl_AppendResult (interp, "error opening file \"",
                              filename, "\"", (char *) NULL);
            result = TCL_ERROR;
            goto cleanup;
        }
        for (;;) {
            int nread;
            char *fbuf = XML_GetBuffer (parser, TDOM_EXPAT_READ_SIZE);
            if (!fbuf) {
                close (fd);
                Tcl_ResetResult (interp);
                Tcl_SetResult (interp, "Out of memory\n", NULL);
                result = TCL_ERROR;
                goto cleanup;







|







5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
            Tcl_ResetResult (interp);
            Tcl_AppendResult (interp, "error opening file \"",
                              filename, "\"", (char *) NULL);
            result = TCL_ERROR;
            goto cleanup;
        }
        for (;;) {
            domLength nread;
            char *fbuf = XML_GetBuffer (parser, TDOM_EXPAT_READ_SIZE);
            if (!fbuf) {
                close (fd);
                Tcl_ResetResult (interp);
                Tcl_SetResult (interp, "Out of memory\n", NULL);
                result = TCL_ERROR;
                goto cleanup;

Changes to generic/schema.h.

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#define ELEMENTTYPE_DEF        64
#define FORWARD_TYPE_DEF      128
#define TYPED_ELEMENT         256
#define HASH_ENTRY_DELETED    512
#define ANY_NOT              1024 

typedef struct domKeyConstraint {
    char  *name;
    ast    selector;
    ast   *fields;
    int    nrFields;
    int    flags;
    char  *emptyFieldSetValue;
    int    efsv_len;
    struct domKeyConstraint *next;
} domKeyConstraint;

typedef struct 
{
    char *name;
    int active;







|
|
|
|
|
|
|







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#define ELEMENTTYPE_DEF        64
#define FORWARD_TYPE_DEF      128
#define TYPED_ELEMENT         256
#define HASH_ENTRY_DELETED    512
#define ANY_NOT              1024 

typedef struct domKeyConstraint {
    char     *name;
    ast       selector;
    ast      *fields;
    domLength nrFields;
    int       flags;
    char     *emptyFieldSetValue;
    size_t    efsv_len;
    struct domKeyConstraint *next;
} domKeyConstraint;

typedef struct 
{
    char *name;
    int active;

Changes to generic/tcldom.c.

1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
....
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810

static
int selectNodesQueryList (
    Tcl_Interp       * interp,
    domNode          * node,
    Tcl_Obj          * queryList,
    ast                tt, 
    int                queryListInd,
    int                queryListLen,
    char            ** prefixMappings,
    xpathCBs         * cbs,
    xpathParseVarCB  * parseVarCB,
    Tcl_HashTable    * cache,
    Tcl_Obj          * result,
    xpathResultType  * type
)
................................................................................
    int         objc,
    Tcl_Obj    *const objv[]
)
{
    char          *xpathQuery, *typeVar, *option, *query;
    char          *errMsg = NULL, **mappings = NULL;
    int            rc, optionIndex, localmapping = 0, cache = 0;
    int            mappingListObjLen = 0, list = 0, hnew;
    domLength      i, len, xpathListLen;
    xpathResultSet rs;
    Tcl_Obj       *objPtr, *objPtr1, *mappingListObj = NULL;
    Tcl_Obj       *queryObj, *result;
    xpathCBs       cbs;
    xpathParseVarCB parseVarCB;
    Tcl_HashTable *xpathCache = NULL;
    Tcl_HashEntry *h = NULL;







|
|







 







|
|







1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
....
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810

static
int selectNodesQueryList (
    Tcl_Interp       * interp,
    domNode          * node,
    Tcl_Obj          * queryList,
    ast                tt, 
    domLength          queryListInd,
    domLength          queryListLen,
    char            ** prefixMappings,
    xpathCBs         * cbs,
    xpathParseVarCB  * parseVarCB,
    Tcl_HashTable    * cache,
    Tcl_Obj          * result,
    xpathResultType  * type
)
................................................................................
    int         objc,
    Tcl_Obj    *const objv[]
)
{
    char          *xpathQuery, *typeVar, *option, *query;
    char          *errMsg = NULL, **mappings = NULL;
    int            rc, optionIndex, localmapping = 0, cache = 0;
    int            list = 0, hnew;
    domLength      i, len, xpathListLen, mappingListObjLen = 0;
    xpathResultSet rs;
    Tcl_Obj       *objPtr, *objPtr1, *mappingListObj = NULL;
    Tcl_Obj       *queryObj, *result;
    xpathCBs       cbs;
    xpathParseVarCB parseVarCB;
    Tcl_HashTable *xpathCache = NULL;
    Tcl_HashEntry *h = NULL;

Changes to generic/tclexpat.c.

1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
....
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
          Tcl_AppendResult (interp, "error opening file \"",
                            data, "\"", (char *) NULL);
          return TCL_ERROR;
      }
      parser = expat->parser;
      expat->parsingState = 2;
      for (;;) {
          int nread;
          char *fbuf = XML_GetBuffer (parser, TDOM_EXPAT_READ_SIZE);
          if (!fbuf) {
              close (fd);
              Tcl_ResetResult (interp);
              Tcl_SetResult (interp, "Out of memory\n", NULL);
              expat->parsingState = 1;
              return TCL_ERROR;
................................................................................
              Tcl_DecrRefCount (resultObj);
              XML_ParserFree (extparser);
              expat->parser = oldparser;
              return 0;
          }
          result = 1;
          for (;;) {
              int nread;
              char *fbuf = XML_GetBuffer (extparser, TDOM_EXPAT_READ_SIZE);
              if (!fbuf) {
                  close (fd);
                  Tcl_ResetResult (expat->interp);
                  Tcl_SetResult (expat->interp, "Out of memory\n", NULL);
                  TclExpatHandlerResult (expat, activeTclHandlerSet,
                                         ERROR_IN_EXTREFHANDLER);







|







 







|







1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
....
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
          Tcl_AppendResult (interp, "error opening file \"",
                            data, "\"", (char *) NULL);
          return TCL_ERROR;
      }
      parser = expat->parser;
      expat->parsingState = 2;
      for (;;) {
          domLength nread;
          char *fbuf = XML_GetBuffer (parser, TDOM_EXPAT_READ_SIZE);
          if (!fbuf) {
              close (fd);
              Tcl_ResetResult (interp);
              Tcl_SetResult (interp, "Out of memory\n", NULL);
              expat->parsingState = 1;
              return TCL_ERROR;
................................................................................
              Tcl_DecrRefCount (resultObj);
              XML_ParserFree (extparser);
              expat->parser = oldparser;
              return 0;
          }
          result = 1;
          for (;;) {
              size_t nread;
              char *fbuf = XML_GetBuffer (extparser, TDOM_EXPAT_READ_SIZE);
              if (!fbuf) {
                  close (fd);
                  Tcl_ResetResult (expat->interp);
                  Tcl_SetResult (expat->interp, "Out of memory\n", NULL);
                  TclExpatHandlerResult (expat, activeTclHandlerSet,
                                         ERROR_IN_EXTREFHANDLER);

Changes to generic/xmlsimple.c.

339
340
341
342
343
344
345

346
347
348
349
350
351
352
...
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
...
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
    int          keepCDATA,
    int          forest,
    char       **errStr
) {
    register int   c;          /* Next character of the input file */
    register char *pn;
    register char *x, *start, *piSep;

    domLength      saved;
    int            hasContent;
    domNode       *node;
    domNode       *parent_node = parent;
    domTextNode   *tnode;
    domAttrNode   *attrnode, *lastAttr, *attrList;
    int            ampersandSeen = 0;
................................................................................
                nArgName = x - ArgName;
                while (SPACE(*x)) {
                    x++;
                }
                if (*x=='=') {
                    x++;
                }
                saved = *(ArgName + nArgName);
                *(ArgName + nArgName) = '\0'; /* terminate arg name */

                while (SPACE(*x)) {
                    x++;
                }
                if (*x=='>' || *x==0) {
                    ArgVal = ArgName;
................................................................................
                    } else {
                        attrList = attrnode;
                    }
                    lastAttr = attrnode;
#ifdef TDOM_NS
                }
#endif 
                *(ArgName + nArgName) = saved;
                while (SPACE(*x)) {
                    x++;
                }
            }

#ifdef TDOM_NS
            /*----------------------------------------------------------







>







 







|







 







|







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
...
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
...
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
    int          keepCDATA,
    int          forest,
    char       **errStr
) {
    register int   c;          /* Next character of the input file */
    register char *pn;
    register char *x, *start, *piSep;
    char           savedChar;
    domLength      saved;
    int            hasContent;
    domNode       *node;
    domNode       *parent_node = parent;
    domTextNode   *tnode;
    domAttrNode   *attrnode, *lastAttr, *attrList;
    int            ampersandSeen = 0;
................................................................................
                nArgName = x - ArgName;
                while (SPACE(*x)) {
                    x++;
                }
                if (*x=='=') {
                    x++;
                }
                savedChar = *(ArgName + nArgName);
                *(ArgName + nArgName) = '\0'; /* terminate arg name */

                while (SPACE(*x)) {
                    x++;
                }
                if (*x=='>' || *x==0) {
                    ArgVal = ArgName;
................................................................................
                    } else {
                        attrList = attrnode;
                    }
                    lastAttr = attrnode;
#ifdef TDOM_NS
                }
#endif 
                *(ArgName + nArgName) = savedChar;
                while (SPACE(*x)) {
                    x++;
                }
            }

#ifdef TDOM_NS
            /*----------------------------------------------------------