xml/cxmllibrary/dictionary/readme.txt
author hgs
Wed, 23 Jun 2010 20:27:15 +0530
changeset 24 74f0b3eb154c
permissions -rw-r--r--
201024
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
hgs
parents:
diff changeset
     1
About the WBXML Token Dictionaries
hgs
parents:
diff changeset
     2
hgs
parents:
diff changeset
     3
WBXML can use tokens to represent tag names, attribute names, attribute
hgs
parents:
diff changeset
     4
names combined with part or all of the attribute value, and part or all
hgs
parents:
diff changeset
     5
of an attribute value.
hgs
parents:
diff changeset
     6
hgs
parents:
diff changeset
     7
The cXML code needs internal tables that map tokens to strings and strings
hgs
parents:
diff changeset
     8
to tokens.  To simplify the generation of these tables (dictionaries) a
hgs
parents:
diff changeset
     9
simple data file giving token-string pairs is processed by a dictionary
hgs
parents:
diff changeset
    10
creator utility program which outputs the required .h and .c files.
hgs
parents:
diff changeset
    11
hgs
parents:
diff changeset
    12
The dictionary creator program source code is in dict_creator.c and it
hgs
parents:
diff changeset
    13
is a stand-alone program.  To compile it with the MS C compiler use the
hgs
parents:
diff changeset
    14
command: cl /Zi /W4 /WX dict_creator.c
hgs
parents:
diff changeset
    15
hgs
parents:
diff changeset
    16
If you encounter following errors about lib.c can't be found or stdio.h is 
hgs
parents:
diff changeset
    17
not found in path, you need to set up system var:
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
INCLUDE: C:\progra~1\micros~3\VC98\Include
hgs
parents:
diff changeset
    20
LIB: C:\progra~1\micros~3\VC98\lib
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
To get dict_creator usage info run dict_creator with no arguments.
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
Files with extension ".dict" are data input files.
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
Example runs:
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
dict_creator xhtml_1_0.dict xhtml_1_0_dict.c nw_xhtml_xhtml_1_0_tokens.h
hgs
parents:
diff changeset
    29
dict_creator wml_1_3.dict wml_1_3_dict.c nw_wml1x_wml_1_3_tokens.h
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
dict_creator si.dict si_dict.c si_dict.h
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
You have to get through dict_creator without errors and then you have to
hgs
parents:
diff changeset
    35
get through the C compiler on the output.  If the output doesn't compile,
hgs
parents:
diff changeset
    36
it may be because dict_creator did something wrong.  Dict_creator has to
hgs
parents:
diff changeset
    37
make a few transformations on the input to create C variable names and it
hgs
parents:
diff changeset
    38
is possible (though we hope never encountered in use) that this produces
hgs
parents:
diff changeset
    39
output that won't compile.
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
END