tDOM

Check-in [672fc9ca28]
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:Merged from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | domvalidation
Files: files | file ages | folders
SHA3-256: 672fc9ca28d5fbdda879e7f0774aa50d3da182d8b1058e912dcbaa2b9df78ea5
User & Date: rolf 2019-06-06 23:23:42
Context
2019-06-06
23:23
Merged from trunk. Leaf check-in: 672fc9ca28 user: rolf tags: domvalidation
2019-05-09
18:31
Reworked (and renamed) selectNodesNamespaces to make it usable from elsewhere and made it public. Leaf check-in: 4ca5de8963 user: rolf tags: trunk
2018-12-14
09:54
Merged from trunk. check-in: 6a48682b06 user: rolf tags: domvalidation
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to configure.

648
649
650
651
652
653
654

655
656
657
658
659
660
661
....
5183
5184
5185
5186
5187
5188
5189


































































































5190
5191
5192
5193
5194
5195
5196
....
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
RC
CELIB_DIR
AR
STUBS_BUILD
SHARED_BUILD
TCL_THREADS
TCL_INCLUDES

PKG_OBJECTS
PKG_SOURCES
EGREP
GREP
RANLIB
SET_MAKE
CPP
................................................................................
        esac


#--------------------------------------------------------------------
# Add HTML5 parsing support.
#--------------------------------------------------------------------




































































































    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable support for HTML5 parsing (using gumbo)" >&5
$as_echo_n "checking whether to enable support for HTML5 parsing (using gumbo)... " >&6; }
    # Check whether --enable-html5 was given.
if test "${enable_html5+set}" = set; then :
  enableval=$enable_html5; tcl_ok=$enableval
else
................................................................................
    else
        tcl_ok=no
    fi
    HTML5_LIBS=""
    HTML5_INCLUDES=""
    if test "$tcl_ok" = "yes" ; then
        # Check if pkg-config is available
        PKGCONFIG=no
        pkg-config --version > /dev/null 2>&1 && PKGCONFIG=yes
        if test "$PKGCONFIG" = no; then
            tcl_ok=no
	    as_fn_error $? "cannot find pkg-config needed for --enable-html5." "$LINENO" 5
        fi
    fi
    if test "$tcl_ok" = "yes" ; then
        HAVEGUMBO=`pkg-config --exists gumbo && echo "1"`
        if test "$HAVEGUMBO" = "1" ; then
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
            $as_echo "#define TDOM_HAVE_GUMBO 1" >>confdefs.h

            if test "${TEA_PLATFORM}" = "windows" ; then
                HTML5_LIBS="-Wl,-Bstatic `pkg-config --static --libs gumbo` -Wl,-Bdynamic"
            else
                HTML5_LIBS="`pkg-config --libs gumbo`"
            fi
            HTML5_INCLUDES="`pkg-config --cflags gumbo`"
        else
            as_fn_error $? "The required lib gumbo not found" "$LINENO" 5
        fi
    else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
    fi






>







 







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







 







|
<
<





|






|

|

|







648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
....
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
....
5303
5304
5305
5306
5307
5308
5309
5310


5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
RC
CELIB_DIR
AR
STUBS_BUILD
SHARED_BUILD
TCL_THREADS
TCL_INCLUDES
PKG_CONFIG
PKG_OBJECTS
PKG_SOURCES
EGREP
GREP
RANLIB
SET_MAKE
CPP
................................................................................
        esac


#--------------------------------------------------------------------
# Add HTML5 parsing support.
#--------------------------------------------------------------------


    if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $PKG_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
  done
IFS=$as_save_IFS

  ;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
  ac_pt_PKG_CONFIG=$PKG_CONFIG
  # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $ac_pt_PKG_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_exec_ext in '' $ac_executable_extensions; do
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
  done
IFS=$as_save_IFS

  ;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_pt_PKG_CONFIG" = x; then
    PKG_CONFIG=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    PKG_CONFIG=$ac_pt_PKG_CONFIG
  fi
else
  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable support for HTML5 parsing (using gumbo)" >&5
$as_echo_n "checking whether to enable support for HTML5 parsing (using gumbo)... " >&6; }
    # Check whether --enable-html5 was given.
if test "${enable_html5+set}" = set; then :
  enableval=$enable_html5; tcl_ok=$enableval
else
................................................................................
    else
        tcl_ok=no
    fi
    HTML5_LIBS=""
    HTML5_INCLUDES=""
    if test "$tcl_ok" = "yes" ; then
        # Check if pkg-config is available
        if test "x$PKG_CONFIG" = x; then


            tcl_ok=no
	    as_fn_error $? "cannot find pkg-config needed for --enable-html5." "$LINENO" 5
        fi
    fi
    if test "$tcl_ok" = "yes" ; then
        HAVEGUMBO=`$PKG_CONFIG --exists gumbo && echo "1"`
        if test "$HAVEGUMBO" = "1" ; then
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
            $as_echo "#define TDOM_HAVE_GUMBO 1" >>confdefs.h

            if test "${TEA_PLATFORM}" = "windows" ; then
                HTML5_LIBS="-Wl,-Bstatic `$PKG_CONFIG --static --libs gumbo` -Wl,-Bdynamic"
            else
                HTML5_LIBS="`$PKG_CONFIG --libs gumbo`"
            fi
            HTML5_INCLUDES="`$PKG_CONFIG --cflags gumbo`"
        else
            as_fn_error $? "The required lib gumbo not found" "$LINENO" 5
        fi
    else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
    fi

Changes to generic/dom.c.

7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
    int               dtdvalidation;
    /* Now the tdom cmd specific elements */
    int               tdomStatus;
    Tcl_Obj          *extResolver;

} tdomCmdReadInfo;

EXTERN int tcldom_returnDocumentObj (Tcl_Interp *interp, 
                                     domDocument *document,
                                     int setVariable, Tcl_Obj *var_name,
                                     int trace, int forOwnerDocument);

void
tdom_freeProc (
    Tcl_Interp *interp,
    void       *userData
)
{






|
|
|
|







7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
    int               dtdvalidation;
    /* Now the tdom cmd specific elements */
    int               tdomStatus;
    Tcl_Obj          *extResolver;

} tdomCmdReadInfo;

int tcldom_returnDocumentObj (Tcl_Interp *interp, 
                              domDocument *document,
                              int setVariable, Tcl_Obj *var_name,
                              int trace, int forOwnerDocument);

void
tdom_freeProc (
    Tcl_Interp *interp,
    void       *userData
)
{

Changes to generic/tcldom.c.

2512
2513
2514
2515
2516
2517
2518




2519
2520
2521

2522
2523
2524
2525
2526
2527
2528
....
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948

3949
3950

3951
3952
3953
3954

3955












3956
3957
3958
3959
3960
3961
3962
3963
3964
3965



3966
3967
3968





3969
3970

3971

3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
....
5916
5917
5918
5919
5920
5921
5922

5923
5924
5925
5926
5927
5928
5929
5930
5931
                    }
                    if (clen == 4 || outputFlags & SERIALIZE_ESCAPE_NON_ASCII) {
                        if (clen == 4) {
                            unicode = ((pc[0] & 0x07) << 18) 
                                + ((pc[1] & 0x3F) << 12)
                                + ((pc[2] & 0x3F) <<  6) 
                                + (pc[3] & 0x3F);




                        } else {
                            unicode = 0;
                            Tcl_UtfToUniChar(pc, (Tcl_UniChar*)&unicode);

                        }
                        AP('&') AP('#')
                        sprintf(charRef, "%d", unicode);
                        for (i = 0; i < (int)strlen(charRef); i++) {
                            AP(charRef[i]);
                        }
                        AP(';')
................................................................................
    return TCL_OK;
}

/*----------------------------------------------------------------------------
|   selectNodesNamespaces
|
\---------------------------------------------------------------------------*/
static int selectNodesNamespaces (
    domDocument *doc,
    Tcl_Interp  *interp,
    int          objc,
    Tcl_Obj     *const objv[] 

    )
{

    int      len, i, result;
    Tcl_Obj *objPtr, *listPtr;

    CheckArgs (2,3,2, "?prefixUriList?");

    if (objc == 3) {












        result = Tcl_ListObjLength (interp, objv[2], &len);
        if (result != TCL_OK || (len % 2) != 0) {
            SetResult ("The optional argument to the selectNodesNamespaces"
                       " method must be a 'prefix namespace' pairs list");
            return TCL_ERROR;
        }
        i = 0;
        if (doc->prefixNSMappings) {
            while (doc->prefixNSMappings[i]) {
                FREE (doc->prefixNSMappings[i]);



                i++;
            }
        }





        if (i < len + 1) {
            if (doc->prefixNSMappings) FREE (doc->prefixNSMappings);

            doc->prefixNSMappings = MALLOC (sizeof (char*)*(len+1));

        }
        for (i = 0; i < len; i++) {
            Tcl_ListObjIndex (interp, objv[2], i, &objPtr);
            doc->prefixNSMappings[i] = tdomstrdup (Tcl_GetString (objPtr));
        }
        doc->prefixNSMappings[len] = NULL;
        Tcl_SetObjResult (interp, objv[2]);
    } else {
        listPtr = Tcl_NewListObj (0, NULL);
        i = 0;
        if (doc->prefixNSMappings) {
            while (doc->prefixNSMappings[i]) {
                objPtr = Tcl_NewStringObj (doc->prefixNSMappings[i], -1);
                Tcl_ListObjAppendElement (interp, listPtr, objPtr);
                i++;
            }
        }
        Tcl_SetObjResult (interp, listPtr);
    }
    return TCL_OK;
}

/*----------------------------------------------------------------------------
|   renameNodes
|
\---------------------------------------------------------------------------*/
................................................................................
            SetResult("DOCUMENT_NODE");
            return TCL_OK;

        case m_cdataSectionElements:
            return cdataSectionElements (doc, interp, objc, objv);

        case m_selectNodesNamespaces:

            return selectNodesNamespaces (doc, interp, objc, objv);

        case m_renameNode:
            return renameNodes (doc, interp, objc, objv);
            
        case m_deleteXPathCache:
            return deleteXPathCache (doc, interp, objc, objv);

        case m_appendChild:






>
>
>
>

|
<
>







 







|
|


|
>


>




>
|
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
<
<
<
<
>
>
>
|
|
|
>
>
>
>
>
|
<
>
|
>
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<







 







>
|
|







2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524

2525
2526
2527
2528
2529
2530
2531
2532
....
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980




3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992

3993
3994
3995
3996
3997
3998
3999
4000
4001
4002












4003
4004
4005
4006
4007
4008
4009
....
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
                    }
                    if (clen == 4 || outputFlags & SERIALIZE_ESCAPE_NON_ASCII) {
                        if (clen == 4) {
                            unicode = ((pc[0] & 0x07) << 18) 
                                + ((pc[1] & 0x3F) << 12)
                                + ((pc[2] & 0x3F) <<  6) 
                                + (pc[3] & 0x3F);
                        } else if (clen == 3) {
                            unicode = ((pc[0] & 0x0F) << 12) 
                                + ((pc[1] & 0x3F) << 6)
                                + (pc[2] & 0x3F);
                        } else {
                            unicode = ((pc[0] & 0x1F) << 6) 

                                + (pc[1] & 0x3F);
                        }
                        AP('&') AP('#')
                        sprintf(charRef, "%d", unicode);
                        for (i = 0; i < (int)strlen(charRef); i++) {
                            AP(charRef[i]);
                        }
                        AP(';')
................................................................................
    return TCL_OK;
}

/*----------------------------------------------------------------------------
|   selectNodesNamespaces
|
\---------------------------------------------------------------------------*/
int tcldom_prefixNSlist (
    char      ***prefixnsPtr,
    Tcl_Interp  *interp,
    int          objc,
    Tcl_Obj     *const objv[],
    const char  *methodName
    )
{
    char   **prefixns = *prefixnsPtr;
    int      len, i, result;
    Tcl_Obj *objPtr, *listPtr;

    CheckArgs (2,3,2, "?prefixUriList?");
    i = 0;
    if (objc == 2) {
        if (!prefixns) return TCL_OK;
        listPtr = Tcl_NewListObj (0, NULL);
        i = 0;
        while (prefixns[i]) {
            Tcl_ListObjAppendElement (
                interp, listPtr, Tcl_NewStringObj (prefixns[i], -1)
                );
            i++;
        }
        Tcl_SetObjResult (interp, listPtr);
        return TCL_OK;
    }
    result = Tcl_ListObjLength (interp, objv[2], &len);
    if (result != TCL_OK || (len % 2) != 0) {
        SetResult3 ("The optional argument to the ", methodName, 
                   " method must be a 'prefix namespace' pairs list");
        return TCL_ERROR;
    }




    if (prefixns) {
        while (prefixns[i]) {
            FREE (prefixns[i]);
            i++;
        }
    }
    if (len == 0) {
        FREE (prefixns);
        *prefixnsPtr = NULL;
        return TCL_OK;
    }
    if (i < len + 1) {

        if (prefixns) FREE (prefixns);
        prefixns = MALLOC (sizeof (char*) * (len+1));
        *prefixnsPtr = prefixns;
    }
    for (i = 0; i < len; i++) {
        Tcl_ListObjIndex (interp, objv[2], i, &objPtr);
        prefixns[i] = tdomstrdup (Tcl_GetString (objPtr));
    }
    prefixns[len] = NULL;
    Tcl_SetObjResult (interp, objv[2]);












    return TCL_OK;
}

/*----------------------------------------------------------------------------
|   renameNodes
|
\---------------------------------------------------------------------------*/
................................................................................
            SetResult("DOCUMENT_NODE");
            return TCL_OK;

        case m_cdataSectionElements:
            return cdataSectionElements (doc, interp, objc, objv);

        case m_selectNodesNamespaces:
            return tcldom_prefixNSlist (&(doc->prefixNSMappings), interp, objc,
                                        objv, "selectNodesNamespaces");
            
        case m_renameNode:
            return renameNodes (doc, interp, objc, objv);
            
        case m_deleteXPathCache:
            return deleteXPathCache (doc, interp, objc, objv);

        case m_appendChild:

Changes to generic/tcldom.h.

48
49
50
51
52
53
54


55
56
57
58
59
60
61
..
65
66
67
68
69
70
71
72
73
74
75
76
77
int  tcldom_PIValueCheck(Tcl_Interp *interp, char *text);
int  tcldom_PINameCheck(Tcl_Interp *interp, char *name);
int  tcldom_nameCheck(Tcl_Interp *interp, char *name, char *nameType,
                      int isFQName);
void tcldom_createNodeObj(Tcl_Interp * interp, domNode *node,
                          char *objCmdName);




void tcldom_initialize(void);

Tcl_ObjCmdProc tcldom_DomObjCmd;
Tcl_ObjCmdProc tcldom_DocObjCmd;
Tcl_ObjCmdProc tcldom_NodeObjCmd;
Tcl_ObjCmdProc TclExpatObjCmd;
................................................................................
#if defined(_MSC_VER) || defined(__MINGW32__)
#  undef TCL_STORAGE_CLASS
#  define TCL_STORAGE_CLASS DLLEXPORT
#endif

#define STR_TDOM_VERSION(v) (VERSION)

EXTERN int Tdom_Init     (Tcl_Interp *interp);
EXTERN int Tdom_SafeInit (Tcl_Interp *interp);

#endif








>
>







 







|
|




48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
67
68
69
70
71
72
73
74
75
76
77
78
79
int  tcldom_PIValueCheck(Tcl_Interp *interp, char *text);
int  tcldom_PINameCheck(Tcl_Interp *interp, char *name);
int  tcldom_nameCheck(Tcl_Interp *interp, char *name, char *nameType,
                      int isFQName);
void tcldom_createNodeObj(Tcl_Interp * interp, domNode *node,
                          char *objCmdName);

int tcldom_prefixNSlist (char ***prefixnsPtr, Tcl_Interp *interp, int objc,
                         Tcl_Obj *const objv[], const char *methodName);

void tcldom_initialize(void);

Tcl_ObjCmdProc tcldom_DomObjCmd;
Tcl_ObjCmdProc tcldom_DocObjCmd;
Tcl_ObjCmdProc tcldom_NodeObjCmd;
Tcl_ObjCmdProc TclExpatObjCmd;
................................................................................
#if defined(_MSC_VER) || defined(__MINGW32__)
#  undef TCL_STORAGE_CLASS
#  define TCL_STORAGE_CLASS DLLEXPORT
#endif

#define STR_TDOM_VERSION(v) (VERSION)

int Tdom_Init     (Tcl_Interp *interp);
int Tdom_SafeInit (Tcl_Interp *interp);

#endif


Changes to generic/tclexpat.h.

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
\-------------------------------------------------------------------------*/

#if defined(_MSC_VER) || defined(BUILD_tdom) || defined(__MINGW32__) 
#  undef TCL_STORAGE_CLASS
#  define TCL_STORAGE_CLASS DLLEXPORT
#endif

EXTERN Tcl_ObjCmdProc TclExpatObjCmd;

EXTERN int CheckExpatParserObj (Tcl_Interp *interp,
				Tcl_Obj *const nameObj);
EXTERN int CHandlerSetInstall (Tcl_Interp *interp,
			       Tcl_Obj *const expatObj,
			       CHandlerSet *handlerSet);
EXTERN int CHandlerSetRemove (Tcl_Interp *interp,
			      Tcl_Obj *const expatObj,
			      char *handlerSetName);
EXTERN CHandlerSet * CHandlerSetCreate (char *name);
EXTERN CHandlerSet * CHandlerSetGet (Tcl_Interp *interp,
                                     Tcl_Obj *const expatObj,
				     char *handlerSetName);
EXTERN void * CHandlerSetGetUserData (Tcl_Interp *interp,
                                      Tcl_Obj *const expatObj,
				      char *handlerSetName);

EXTERN TclGenExpatInfo * GetExpatInfo (Tcl_Interp *interp,
				       Tcl_Obj *const expatObj);






|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
\-------------------------------------------------------------------------*/

#if defined(_MSC_VER) || defined(BUILD_tdom) || defined(__MINGW32__) 
#  undef TCL_STORAGE_CLASS
#  define TCL_STORAGE_CLASS DLLEXPORT
#endif

Tcl_ObjCmdProc TclExpatObjCmd;

int CheckExpatParserObj (Tcl_Interp *interp,
 			Tcl_Obj *const nameObj);
int CHandlerSetInstall (Tcl_Interp *interp,
 		       Tcl_Obj *const expatObj,
 		       CHandlerSet *handlerSet);
int CHandlerSetRemove (Tcl_Interp *interp,
 		      Tcl_Obj *const expatObj,
 		      char *handlerSetName);
CHandlerSet * CHandlerSetCreate (char *name);
CHandlerSet * CHandlerSetGet (Tcl_Interp *interp,
                              Tcl_Obj *const expatObj,
 			     char *handlerSetName);
void * CHandlerSetGetUserData (Tcl_Interp *interp,
                               Tcl_Obj *const expatObj,
 			      char *handlerSetName);

TclGenExpatInfo * GetExpatInfo (Tcl_Interp *interp,
				       Tcl_Obj *const expatObj);

Changes to generic/tdomDecls.h.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#endif

/*
 * Exported function declarations:
 */

/* 0 */
EXTERN int		TclExpatObjCmd(ClientData dummy, Tcl_Interp *interp,
				int objc, Tcl_Obj *const objv[]);
/* 1 */
EXTERN int		CheckExpatParserObj(Tcl_Interp *interp,
				Tcl_Obj *const nameObj);
/* 2 */
EXTERN int		CHandlerSetInstall(Tcl_Interp *interp,
				Tcl_Obj *const expatObj, 
				CHandlerSet *handlerSet);
/* 3 */
EXTERN int		CHandlerSetRemove(Tcl_Interp *interp,
				Tcl_Obj *const expatObj, 
				char *handlerSetName);
/* 4 */
EXTERN CHandlerSet *	CHandlerSetCreate(char *name);
/* 5 */
EXTERN CHandlerSet *	CHandlerSetGet(Tcl_Interp *interp,
				Tcl_Obj *const expatObj, 
				char *handlerSetName);
/* 6 */
EXTERN void *		CHandlerSetGetUserData(Tcl_Interp *interp,
				Tcl_Obj *const expatObj,
				char *handlerSetName);
/* 7 */
EXTERN TclGenExpatInfo * GetExpatInfo(Tcl_Interp *interp,
				Tcl_Obj *const expatObj);
/* 8 */
EXTERN XML_Size		XML_GetCurrentLineNumber(XML_Parser parser);
/* 9 */
EXTERN XML_Size		XML_GetCurrentColumnNumber(XML_Parser parser);
/* 10 */
EXTERN XML_Index	XML_GetCurrentByteIndex(XML_Parser parser);
/* 11 */
EXTERN int		XML_GetCurrentByteCount(XML_Parser parser);
/* 12 */
EXTERN enum XML_Status	XML_SetBase(XML_Parser parser, const XML_Char *base);
/* 13 */
EXTERN const XML_Char *	 XML_GetBase(XML_Parser parser);
/* 14 */
EXTERN int		XML_GetSpecifiedAttributeCount(XML_Parser parser);
/* 15 */
EXTERN int		XML_GetIdAttributeIndex(XML_Parser parser);
/* 16 */
EXTERN domNode *	tcldom_getNodeFromName(Tcl_Interp *interp,
				char *nodeName, char **errMsg);
/* 17 */
EXTERN domDocument *	tcldom_getDocumentFromName(Tcl_Interp *interp,
				char *docName, char **errMsg);

typedef struct TdomStubs {
    int magic;
    void *hooks;

    int (*tclExpatObjCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 0 */
................................................................................
    const XML_Char * (*xML_GetBase) (XML_Parser parser); /* 13 */
    int (*xML_GetSpecifiedAttributeCount) (XML_Parser parser); /* 14 */
    int (*xML_GetIdAttributeIndex) (XML_Parser parser); /* 15 */
    domNode * (*tcldom_getNodeFromName) (Tcl_Interp *interp, char *nodeName, char **errMsg); /* 16 */
    domDocument * (*tcldom_getDocumentFromName) (Tcl_Interp *interp, char *docName, char **errMsg); /* 17 */
} TdomStubs;

extern const TdomStubs *tdomStubsPtr;

#ifdef __cplusplus
}
#endif

#if defined(USE_TDOM_STUBS)







|


|


|
|


|
|


|

|
|


|



|


|

|

|

|

|

|

|

|

|


|







 







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#endif

/*
 * Exported function declarations:
 */

/* 0 */
int		TclExpatObjCmd(ClientData dummy, Tcl_Interp *interp,
				int objc, Tcl_Obj *const objv[]);
/* 1 */
int		CheckExpatParserObj(Tcl_Interp *interp,
				Tcl_Obj *const nameObj);
/* 2 */
int		CHandlerSetInstall(Tcl_Interp *interp,
				Tcl_Obj *const expatObj,
				CHandlerSet *handlerSet);
/* 3 */
int		CHandlerSetRemove(Tcl_Interp *interp,
				Tcl_Obj *const expatObj,
				char *handlerSetName);
/* 4 */
CHandlerSet *	CHandlerSetCreate(char *name);
/* 5 */
CHandlerSet *	CHandlerSetGet(Tcl_Interp *interp,
				Tcl_Obj *const expatObj,
				char *handlerSetName);
/* 6 */
void *		CHandlerSetGetUserData(Tcl_Interp *interp,
				Tcl_Obj *const expatObj,
				char *handlerSetName);
/* 7 */
TclGenExpatInfo * GetExpatInfo(Tcl_Interp *interp,
				Tcl_Obj *const expatObj);
/* 8 */
XML_Size		XML_GetCurrentLineNumber(XML_Parser parser);
/* 9 */
XML_Size		XML_GetCurrentColumnNumber(XML_Parser parser);
/* 10 */
XML_Index	XML_GetCurrentByteIndex(XML_Parser parser);
/* 11 */
int		XML_GetCurrentByteCount(XML_Parser parser);
/* 12 */
enum XML_Status	XML_SetBase(XML_Parser parser, const XML_Char *base);
/* 13 */
const XML_Char *	 XML_GetBase(XML_Parser parser);
/* 14 */
int		XML_GetSpecifiedAttributeCount(XML_Parser parser);
/* 15 */
int		XML_GetIdAttributeIndex(XML_Parser parser);
/* 16 */
domNode *	tcldom_getNodeFromName(Tcl_Interp *interp,
				char *nodeName, char **errMsg);
/* 17 */
domDocument *	tcldom_getDocumentFromName(Tcl_Interp *interp,
				char *docName, char **errMsg);

typedef struct TdomStubs {
    int magic;
    void *hooks;

    int (*tclExpatObjCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 0 */
................................................................................
    const XML_Char * (*xML_GetBase) (XML_Parser parser); /* 13 */
    int (*xML_GetSpecifiedAttributeCount) (XML_Parser parser); /* 14 */
    int (*xML_GetIdAttributeIndex) (XML_Parser parser); /* 15 */
    domNode * (*tcldom_getNodeFromName) (Tcl_Interp *interp, char *nodeName, char **errMsg); /* 16 */
    domDocument * (*tcldom_getDocumentFromName) (Tcl_Interp *interp, char *docName, char **errMsg); /* 17 */
} TdomStubs;

const TdomStubs *tdomStubsPtr;

#ifdef __cplusplus
}
#endif

#if defined(USE_TDOM_STUBS)

Changes to lib/tdom.tcl.

637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
...
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
...
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
...
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
...
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
...
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
...
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
# cp1251 koi8-u macDingbats iso8859-7 cp1252 iso8859-8 cp1253
# iso8859-9 cp1254 cp1255 cp850 cp1256 cp932 identity cp1257 cp852
# macJapan cp1258 shiftjis utf-8 cp855 cp936 symbol cp775 unicode
# cp857
# 
# Just add more mappings (and mail them to the tDOM mailing list, please).

proc tdom::IANAEncoding2TclEncoding {IANAName} {
    
    # First the most widespread encodings with there
    # preferred MIME name, to speed lookup in this
    # usual cases. Later the official names and the
    # aliases.
    #
    # For "official names for character sets that may be
................................................................................
    }
}

#----------------------------------------------------------------------------
#   xmlOpenFileWorker
#
#----------------------------------------------------------------------------
proc tdom::xmlOpenFileWorker {filename {encodingString {}} {forSimple 0} {forRead 0}} {

    # This partly (mis-)use the encoding of a channel handed to [dom
    # parse -channel ..] as a marker: if the channel encoding is utf-8
    # then behind the scene Tcl_Read() is used, otherwise
    # Tcl_ReadChars(). This is used for the encodings understood (and
    # checked) by the used expat implementation: utf-8 and utf-16 (in
    # either byte order).
................................................................................
    return $fd
}

#----------------------------------------------------------------------------
#   xmlOpenFile
#
#----------------------------------------------------------------------------
proc tdom::xmlOpenFile {filename {encodingString {}}} {

    if {$encodingString != {}} {
        upvar $encodingString encString
    }
    
    set fd [xmlOpenFileWorker $filename encString]
    return $fd
}

#----------------------------------------------------------------------------
#   xmlReadFile
#
#----------------------------------------------------------------------------
proc tdom::xmlReadFile {filename {encodingString {}}} {

    if {$encodingString != {}} {
        upvar $encodingString encString
    }
    
    set fd [xmlOpenFileWorker $filename encString 0 1]
    set data [read $fd [file size $filename]]
................................................................................
    return $data
}

#----------------------------------------------------------------------------
#   xmlReadFileForSimple
#
#----------------------------------------------------------------------------
proc tdom::xmlReadFileForSimple {filename {encodingString {}}} {

    if {$encodingString != {}} {
        upvar $encodingString encString
    }
    
    set fd [xmlOpenFileWorker $filename encString 1]
    set data [read $fd [file size $filename]]
................................................................................
#   
#   A very simple external entity resolver, included for convenience.
#   Depends on the tcllib package uri and resolves only file URLs. 
#
#----------------------------------------------------------------------------

if {![catch {package require uri}]} {
    proc tdom::extRefHandler {base systemId publicId} {
        variable extRefHandlerDebug
        variable useForeignDTD

        if {$extRefHandlerDebug} {
            puts stderr "tdom::extRefHandler called with:"
            puts stderr "\tbase:     '$base'"
            puts stderr "\tsystemId: '$systemId'"
            puts stderr "\tpublicId: '$publicId'"
        }
        if {$systemId == ""} {
            if {$useForeignDTD != ""} {
                set systemId $useForeignDTD
................................................................................
#----------------------------------------------------------------------------
#   baseURL
#   
#   A simple convenience proc which returns an absolute URL for a given
#   filename.
#
#----------------------------------------------------------------------------
proc tdom::baseURL {path} {
    # FIXME - path components need to be URL-encoded

    # Note [file join] will return path as is if it is already absolute.
    # Also on Windows, it will change \ -> /. This is necessary because
    # file URIs must always use /, never \.
    set path [file join [pwd] $path]

................................................................................
    variable extRefHandlerDebug 0
    variable useForeignDTD ""

    namespace export xmlOpenFile xmlReadFile xmlReadFileForSimple \
        extRefHandler baseURL
}

foreach cmd {
    xmlOpenFile
    xmlReadFile
    xmlReadFileForSimple
    extRefHandler
    baseURL
} {
    interp alias {} tDOM::$cmd {} tdom::$cmd
}

# EOF






|







 







|







 







|













|







 







|







 







|




|







 







|







 







|






|



637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
...
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
...
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
...
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
...
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
...
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
...
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
# cp1251 koi8-u macDingbats iso8859-7 cp1252 iso8859-8 cp1253
# iso8859-9 cp1254 cp1255 cp850 cp1256 cp932 identity cp1257 cp852
# macJapan cp1258 shiftjis utf-8 cp855 cp936 symbol cp775 unicode
# cp857
# 
# Just add more mappings (and mail them to the tDOM mailing list, please).

proc ::tdom::IANAEncoding2TclEncoding {IANAName} {
    
    # First the most widespread encodings with there
    # preferred MIME name, to speed lookup in this
    # usual cases. Later the official names and the
    # aliases.
    #
    # For "official names for character sets that may be
................................................................................
    }
}

#----------------------------------------------------------------------------
#   xmlOpenFileWorker
#
#----------------------------------------------------------------------------
proc ::tdom::xmlOpenFileWorker {filename {encodingString {}} {forSimple 0} {forRead 0}} {

    # This partly (mis-)use the encoding of a channel handed to [dom
    # parse -channel ..] as a marker: if the channel encoding is utf-8
    # then behind the scene Tcl_Read() is used, otherwise
    # Tcl_ReadChars(). This is used for the encodings understood (and
    # checked) by the used expat implementation: utf-8 and utf-16 (in
    # either byte order).
................................................................................
    return $fd
}

#----------------------------------------------------------------------------
#   xmlOpenFile
#
#----------------------------------------------------------------------------
proc ::tdom::xmlOpenFile {filename {encodingString {}}} {

    if {$encodingString != {}} {
        upvar $encodingString encString
    }
    
    set fd [xmlOpenFileWorker $filename encString]
    return $fd
}

#----------------------------------------------------------------------------
#   xmlReadFile
#
#----------------------------------------------------------------------------
proc ::tdom::xmlReadFile {filename {encodingString {}}} {

    if {$encodingString != {}} {
        upvar $encodingString encString
    }
    
    set fd [xmlOpenFileWorker $filename encString 0 1]
    set data [read $fd [file size $filename]]
................................................................................
    return $data
}

#----------------------------------------------------------------------------
#   xmlReadFileForSimple
#
#----------------------------------------------------------------------------
proc ::tdom::xmlReadFileForSimple {filename {encodingString {}}} {

    if {$encodingString != {}} {
        upvar $encodingString encString
    }
    
    set fd [xmlOpenFileWorker $filename encString 1]
    set data [read $fd [file size $filename]]
................................................................................
#   
#   A very simple external entity resolver, included for convenience.
#   Depends on the tcllib package uri and resolves only file URLs. 
#
#----------------------------------------------------------------------------

if {![catch {package require uri}]} {
    proc ::tdom::extRefHandler {base systemId publicId} {
        variable extRefHandlerDebug
        variable useForeignDTD

        if {$extRefHandlerDebug} {
            puts stderr "::tdom::extRefHandler called with:"
            puts stderr "\tbase:     '$base'"
            puts stderr "\tsystemId: '$systemId'"
            puts stderr "\tpublicId: '$publicId'"
        }
        if {$systemId == ""} {
            if {$useForeignDTD != ""} {
                set systemId $useForeignDTD
................................................................................
#----------------------------------------------------------------------------
#   baseURL
#   
#   A simple convenience proc which returns an absolute URL for a given
#   filename.
#
#----------------------------------------------------------------------------
proc ::tdom::baseURL {path} {
    # FIXME - path components need to be URL-encoded

    # Note [file join] will return path as is if it is already absolute.
    # Also on Windows, it will change \ -> /. This is necessary because
    # file URIs must always use /, never \.
    set path [file join [pwd] $path]

................................................................................
    variable extRefHandlerDebug 0
    variable useForeignDTD ""

    namespace export xmlOpenFile xmlReadFile xmlReadFileForSimple \
        extRefHandler baseURL
}

foreach ::tdom::cmd {
    xmlOpenFile
    xmlReadFile
    xmlReadFileForSimple
    extRefHandler
    baseURL
} {
    interp alias {} tDOM::$::tdom::cmd {} tdom::$::tdom::cmd
}

# EOF

Changes to tdom.m4.

221
222
223
224
225
226
227

228
229
230
231
232
233
234
...
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#   Defines the following vars:
#
#   Sets the following vars:
#
#------------------------------------------------------------------------

AC_DEFUN(TDOM_ENABLE_HTML5, [

    AC_MSG_CHECKING([whether to enable support for HTML5 parsing (using gumbo)])
    AC_ARG_ENABLE(html5,
        AC_HELP_STRING([--enable-html5],
            [build with HTML5 parsing support (default: off)]),
        [tcl_ok=$enableval], [tcl_ok=no])

    if test "${enable_html5+set}" = set; then
................................................................................
    else
        tcl_ok=no
    fi
    HTML5_LIBS=""
    HTML5_INCLUDES=""
    if test "$tcl_ok" = "yes" ; then
        # Check if pkg-config is available
        PKGCONFIG=no
        pkg-config --version > /dev/null 2>&1 && PKGCONFIG=yes
        if test "$PKGCONFIG" = no; then
            tcl_ok=no
	    AC_MSG_ERROR([cannot find pkg-config needed for --enable-html5.])
        fi
    fi
    if test "$tcl_ok" = "yes" ; then
        HAVEGUMBO=`pkg-config --exists gumbo && echo "1"`
        if test "$HAVEGUMBO" = "1" ; then
            AC_MSG_RESULT([yes])
            AC_DEFINE(TDOM_HAVE_GUMBO)
            if test "${TEA_PLATFORM}" = "windows" ; then
                HTML5_LIBS="-Wl,-Bstatic `pkg-config --static --libs gumbo` -Wl,-Bdynamic"
            else
                HTML5_LIBS="`pkg-config --libs gumbo`"
            fi
            HTML5_INCLUDES="`pkg-config --cflags gumbo`"
        else
            AC_MSG_ERROR([The required lib gumbo not found])
        fi
    else    
        AC_MSG_RESULT([no])
    fi
])






>







 







|
<
<





|




|

|

|







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
...
238
239
240
241
242
243
244
245


246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#   Defines the following vars:
#
#   Sets the following vars:
#
#------------------------------------------------------------------------

AC_DEFUN(TDOM_ENABLE_HTML5, [
    AC_PATH_TOOL([PKG_CONFIG],[pkg-config])
    AC_MSG_CHECKING([whether to enable support for HTML5 parsing (using gumbo)])
    AC_ARG_ENABLE(html5,
        AC_HELP_STRING([--enable-html5],
            [build with HTML5 parsing support (default: off)]),
        [tcl_ok=$enableval], [tcl_ok=no])

    if test "${enable_html5+set}" = set; then
................................................................................
    else
        tcl_ok=no
    fi
    HTML5_LIBS=""
    HTML5_INCLUDES=""
    if test "$tcl_ok" = "yes" ; then
        # Check if pkg-config is available
        if test "x$PKG_CONFIG" = x; then


            tcl_ok=no
	    AC_MSG_ERROR([cannot find pkg-config needed for --enable-html5.])
        fi
    fi
    if test "$tcl_ok" = "yes" ; then
        HAVEGUMBO=`$PKG_CONFIG --exists gumbo && echo "1"`
        if test "$HAVEGUMBO" = "1" ; then
            AC_MSG_RESULT([yes])
            AC_DEFINE(TDOM_HAVE_GUMBO)
            if test "${TEA_PLATFORM}" = "windows" ; then
                HTML5_LIBS="-Wl,-Bstatic `$PKG_CONFIG --static --libs gumbo` -Wl,-Bdynamic"
            else
                HTML5_LIBS="`$PKG_CONFIG --libs gumbo`"
            fi
            HTML5_INCLUDES="`$PKG_CONFIG --cflags gumbo`"
        else
            AC_MSG_ERROR([The required lib gumbo not found])
        fi
    else    
        AC_MSG_RESULT([no])
    fi
])

Changes to tests/data/REC-xslt-19991116.xml.

1
2
3
4
5
6
7
8
9
10
11
....
6352
6353
6354
6355
6356
6357
6358



6359
6360
6361
6362
6363
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Id$ -->
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.0//EN"
                      "/XML/1998/06/xmlspec-v20.dtd" [
<!ENTITY XML "http://www.w3.org/TR/REC-xml">
<!ENTITY XMLNames "http://www.w3.org/TR/REC-xml-names">
<!ENTITY XSLT.ns "http://www.w3.org/1999/XSL/Transform">
<!ENTITY XSLTA.ns "http://www.w3.org/1999/XSL/TransformAlias">
<!ENTITY XSLFO.ns "http://www.w3.org/1999/XSL/Format">
<!ENTITY XHTML.ns "http://www.w3.org/TR/xhtml1/strict">
<!ENTITY year "1999">
................................................................................
<item><p>a way to group together consecutive nodes having duplicate
subelements or attributes;</p></item>

<item><p>features to make handling of the HTML <code>style</code>
attribute more convenient.</p></item>

</ulist>




</inform-div1>

</back>
</spec>


|







 







>
>
>





1
2
3
4
5
6
7
8
9
10
11
....
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Id$ -->
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.0//EN"
                      "xmlspec-v20.dtd" [
<!ENTITY XML "http://www.w3.org/TR/REC-xml">
<!ENTITY XMLNames "http://www.w3.org/TR/REC-xml-names">
<!ENTITY XSLT.ns "http://www.w3.org/1999/XSL/Transform">
<!ENTITY XSLTA.ns "http://www.w3.org/1999/XSL/TransformAlias">
<!ENTITY XSLFO.ns "http://www.w3.org/1999/XSL/Format">
<!ENTITY XHTML.ns "http://www.w3.org/TR/xhtml1/strict">
<!ENTITY year "1999">
................................................................................
<item><p>a way to group together consecutive nodes having duplicate
subelements or attributes;</p></item>

<item><p>features to make handling of the HTML <code>style</code>
attribute more convenient.</p></item>

</ulist>

<item><p>features to make handling of the HTML <code>style</code>
attribute more convenient.</p></item>

</inform-div1>

</back>
</spec>

Changes to tests/dom.test.

176
177
178
179
180
181
182













183
184
185
186
187
188
189
    dom createDocument test doc
    set result [catch {set doc foo} errMsg]
    lappend result $errMsg
    $doc delete
    unset doc
    set result
} {1 {can't set "doc": var is read-only}}














test dom-2.1 {Don't quash white space at start or end of non white space content} {
    set doc [dom parse {<root>
    some content
    </root>}]
    set root [$doc documentElement]
    $root text






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







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
    dom createDocument test doc
    set result [catch {set doc foo} errMsg]
    lappend result $errMsg
    $doc delete
    unset doc
    set result
} {1 {can't set "doc": var is read-only}}

test dom-1.25 {Doc var} {
    dom parse <test/> doc
    dom parse <test/> doc
    unset doc
} {}

test dom-1.26 {Doc var} {
    dom parse <test/> doc
    set result [catch {$doc documentElement doc}]
    unset doc
    set result
} {1}

test dom-2.1 {Don't quash white space at start or end of non white space content} {
    set doc [dom parse {<root>
    some content
    </root>}]
    set root [$doc documentElement]
    $root text

Changes to tests/loadtdom.tcl.

10
11
12
13
14
15
16


17
18
19
20
21
22
23
24
25
    # We still support 8.4 to some degree
    package require Tcl 8.4
} else {
    package require Tcl 8.4-
}
package require tcltest 2.2
namespace import ::tcltest::*


if {[catch {package require -exact tdom 0.9.2}]} {
    if {[catch {load [file join [file dir [info script]] ../unix/libtdom0.9.2.so]}]} {
        error "Unable to load the appropriate tDOM version!"
    }
}
if {[info commands ::tdom::xmlReadFile] == ""} {
    # tcldomsh without the script library. Source the lib.
    source [file join [file dir [info script]] ../lib tdom.tcl]
}






>
>









10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    # We still support 8.4 to some degree
    package require Tcl 8.4
} else {
    package require Tcl 8.4-
}
package require tcltest 2.2
namespace import ::tcltest::*
catch {tcltest::loadTestedCommands}

if {[catch {package require -exact tdom 0.9.2}]} {
    if {[catch {load [file join [file dir [info script]] ../unix/libtdom0.9.2.so]}]} {
        error "Unable to load the appropriate tDOM version!"
    }
}
if {[info commands ::tdom::xmlReadFile] == ""} {
    # tcldomsh without the script library. Source the lib.
    source [file join [file dir [info script]] ../lib tdom.tcl]
}