65
80
#define XHTML_NAMESPACE "http://www.w3.org/1999/xhtml"
69
Bind attribute types to procedures to check values.
70
You can add new procedures for better validation
71
and each procedure has access to the node in which
72
the attribute occurred as well as the attribute name
75
By default, attributes are checked without regard
76
to the element they are found on. You have the choice
77
of making the procedure test which element is involved
78
or in writing methods for each element which controls
79
exactly how the attributes of that element are checked.
80
This latter approach is best for detecting the absence
81
of required attributes.
85
AttrCheck CheckScript;
89
AttrCheck CheckValign;
91
AttrCheck CheckLength;
92
AttrCheck CheckTarget;
93
AttrCheck CheckFsubmit;
96
AttrCheck CheckNumber;
100
AttrCheck CheckScroll;
101
AttrCheck CheckTextDir;
82
AttrCheck TY_(CheckUrl);
105
84
/* public method for finding attribute definition by name */
106
const Attribute* CheckAttribute( TidyDocImpl* doc, Node *node, AttVal *attval );
108
const Attribute* FindAttribute( TidyDocImpl* doc, AttVal *attval );
110
AttVal* GetAttrByName( Node *node, ctmbstr name );
112
AttVal* AddAttribute( TidyDocImpl* doc,
113
Node *node, ctmbstr name, ctmbstr value );
115
AttVal* RepairAttrValue(TidyDocImpl* doc, Node* node, ctmbstr name, ctmbstr value);
117
Bool IsUrl( TidyDocImpl* doc, ctmbstr attrname );
119
Bool IsBool( TidyDocImpl* doc, ctmbstr attrname );
121
Bool IsScript( TidyDocImpl* doc, ctmbstr attrname );
85
const Attribute* TY_(CheckAttribute)( TidyDocImpl* doc, Node *node, AttVal *attval );
87
const Attribute* TY_(FindAttribute)( TidyDocImpl* doc, AttVal *attval );
89
AttVal* TY_(GetAttrByName)( Node *node, ctmbstr name );
91
AttVal* TY_(AddAttribute)( TidyDocImpl* doc,
92
Node *node, ctmbstr name, ctmbstr value );
94
AttVal* TY_(RepairAttrValue)(TidyDocImpl* doc, Node* node, ctmbstr name, ctmbstr value);
96
Bool TY_(IsUrl)( TidyDocImpl* doc, ctmbstr attrname );
98
/* Bool IsBool( TidyDocImpl* doc, ctmbstr attrname ); */
100
Bool TY_(IsScript)( TidyDocImpl* doc, ctmbstr attrname );
123
102
/* may id or name serve as anchor? */
124
Bool IsAnchorElement( TidyDocImpl* doc, Node* node );
103
Bool TY_(IsAnchorElement)( TidyDocImpl* doc, Node* node );
127
106
In CSS1, selectors can contain only the characters A-Z, 0-9, and
138
117
#508936 - CSS class naming for -clean option
140
Bool IsCSS1Selector( ctmbstr buf );
119
Bool TY_(IsCSS1Selector)( ctmbstr buf );
142
Bool IsValidHTMLID(ctmbstr id);
143
Bool IsValidXMLID(ctmbstr id);
121
Bool TY_(IsValidHTMLID)(ctmbstr id);
122
Bool TY_(IsValidXMLID)(ctmbstr id);
145
124
/* removes anchor for specific node */
146
void RemoveAnchorByNode( TidyDocImpl* doc, Node *node );
148
/* add new anchor to namespace */
149
Anchor* AddAnchor( TidyDocImpl* doc, ctmbstr name, Node *node );
151
/* return node associated with anchor */
152
Node* GetNodeByAnchor( TidyDocImpl* doc, ctmbstr name );
125
void TY_(RemoveAnchorByNode)( TidyDocImpl* doc, Node *node );
154
127
/* free all anchors */
155
void FreeAnchors( TidyDocImpl* doc );
128
void TY_(FreeAnchors)( TidyDocImpl* doc );
158
131
/* public methods for inititializing/freeing attribute dictionary */
159
void InitAttrs( TidyDocImpl* doc );
160
void FreeAttrTable( TidyDocImpl* doc );
132
void TY_(InitAttrs)( TidyDocImpl* doc );
133
void TY_(FreeAttrTable)( TidyDocImpl* doc );
135
void TY_(AppendToClassAttr)( TidyDocImpl* doc, AttVal *classattr, ctmbstr classname );
163
137
the same attribute name can't be used
164
138
more than once in each element
166
void RepairDuplicateAttributes( TidyDocImpl* doc, Node* node );
168
Bool IsBoolAttribute( AttVal* attval );
169
Bool attrIsEvent( AttVal* attval );
171
AttVal* AttrGetById( Node* node, TidyAttrId id );
173
uint NodeAttributeVersions( Node* node, TidyAttrId id );
140
void TY_(RepairDuplicateAttributes)( TidyDocImpl* doc, Node* node, Bool isXml );
141
void TY_(SortAttributes)(Node* node, TidyAttrSortStrategy strat);
143
Bool TY_(IsBoolAttribute)( AttVal* attval );
144
Bool TY_(attrIsEvent)( AttVal* attval );
146
AttVal* TY_(AttrGetById)( Node* node, TidyAttrId id );
148
uint TY_(NodeAttributeVersions)( Node* node, TidyAttrId id );
175
150
/* 0 == TidyAttr_UNKNOWN */
176
151
#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
345
320
/* Attribute Retrieval macros
347
#define attrGetHREF( nod ) AttrGetById( nod, TidyAttr_HREF )
348
#define attrGetSRC( nod ) AttrGetById( nod, TidyAttr_SRC )
349
#define attrGetID( nod ) AttrGetById( nod, TidyAttr_ID )
350
#define attrGetNAME( nod ) AttrGetById( nod, TidyAttr_NAME )
351
#define attrGetSUMMARY( nod ) AttrGetById( nod, TidyAttr_SUMMARY )
352
#define attrGetALT( nod ) AttrGetById( nod, TidyAttr_ALT )
353
#define attrGetLONGDESC( nod ) AttrGetById( nod, TidyAttr_LONGDESC )
354
#define attrGetUSEMAP( nod ) AttrGetById( nod, TidyAttr_USEMAP )
355
#define attrGetISMAP( nod ) AttrGetById( nod, TidyAttr_ISMAP )
356
#define attrGetLANGUAGE( nod ) AttrGetById( nod, TidyAttr_LANGUAGE )
357
#define attrGetTYPE( nod ) AttrGetById( nod, TidyAttr_TYPE )
358
#define attrGetVALUE( nod ) AttrGetById( nod, TidyAttr_VALUE )
359
#define attrGetCONTENT( nod ) AttrGetById( nod, TidyAttr_CONTENT )
360
#define attrGetTITLE( nod ) AttrGetById( nod, TidyAttr_TITLE )
361
#define attrGetXMLNS( nod ) AttrGetById( nod, TidyAttr_XMLNS )
362
#define attrGetDATAFLD( nod ) AttrGetById( nod, TidyAttr_DATAFLD )
363
#define attrGetWIDTH( nod ) AttrGetById( nod, TidyAttr_WIDTH )
364
#define attrGetHEIGHT( nod ) AttrGetById( nod, TidyAttr_HEIGHT )
365
#define attrGetFOR( nod ) AttrGetById( nod, TidyAttr_FOR )
366
#define attrGetSELECTED( nod ) AttrGetById( nod, TidyAttr_SELECTED )
367
#define attrGetCHECKED( nod ) AttrGetById( nod, TidyAttr_CHECKED )
368
#define attrGetLANG( nod ) AttrGetById( nod, TidyAttr_LANG )
369
#define attrGetTARGET( nod ) AttrGetById( nod, TidyAttr_TARGET )
370
#define attrGetHTTP_EQUIV( nod ) AttrGetById( nod, TidyAttr_HTTP_EQUIV )
371
#define attrGetREL( nod ) AttrGetById( nod, TidyAttr_REL )
373
#define attrGetOnMOUSEMOVE( nod ) AttrGetById( nod, TidyAttr_OnMOUSEMOVE )
374
#define attrGetOnMOUSEDOWN( nod ) AttrGetById( nod, TidyAttr_OnMOUSEDOWN )
375
#define attrGetOnMOUSEUP( nod ) AttrGetById( nod, TidyAttr_OnMOUSEUP )
376
#define attrGetOnCLICK( nod ) AttrGetById( nod, TidyAttr_OnCLICK )
377
#define attrGetOnMOUSEOVER( nod ) AttrGetById( nod, TidyAttr_OnMOUSEOVER )
378
#define attrGetOnMOUSEOUT( nod ) AttrGetById( nod, TidyAttr_OnMOUSEOUT )
379
#define attrGetOnKEYDOWN( nod ) AttrGetById( nod, TidyAttr_OnKEYDOWN )
380
#define attrGetOnKEYUP( nod ) AttrGetById( nod, TidyAttr_OnKEYUP )
381
#define attrGetOnKEYPRESS( nod ) AttrGetById( nod, TidyAttr_OnKEYPRESS )
382
#define attrGetOnFOCUS( nod ) AttrGetById( nod, TidyAttr_OnFOCUS )
383
#define attrGetOnBLUR( nod ) AttrGetById( nod, TidyAttr_OnBLUR )
385
#define attrGetBGCOLOR( nod ) AttrGetById( nod, TidyAttr_BGCOLOR )
387
#define attrGetLINK( nod ) AttrGetById( nod, TidyAttr_LINK )
388
#define attrGetALINK( nod ) AttrGetById( nod, TidyAttr_ALINK )
389
#define attrGetVLINK( nod ) AttrGetById( nod, TidyAttr_VLINK )
391
#define attrGetTEXT( nod ) AttrGetById( nod, TidyAttr_TEXT )
392
#define attrGetSTYLE( nod ) AttrGetById( nod, TidyAttr_STYLE )
393
#define attrGetABBR( nod ) AttrGetById( nod, TidyAttr_ABBR )
394
#define attrGetCOLSPAN( nod ) AttrGetById( nod, TidyAttr_COLSPAN )
395
#define attrGetFONT( nod ) AttrGetById( nod, TidyAttr_FONT )
396
#define attrGetBASEFONT( nod ) AttrGetById( nod, TidyAttr_BASEFONT )
397
#define attrGetROWSPAN( nod ) AttrGetById( nod, TidyAttr_ROWSPAN )
322
#define attrGetHREF( nod ) TY_(AttrGetById)( nod, TidyAttr_HREF )
323
#define attrGetSRC( nod ) TY_(AttrGetById)( nod, TidyAttr_SRC )
324
#define attrGetID( nod ) TY_(AttrGetById)( nod, TidyAttr_ID )
325
#define attrGetNAME( nod ) TY_(AttrGetById)( nod, TidyAttr_NAME )
326
#define attrGetSUMMARY( nod ) TY_(AttrGetById)( nod, TidyAttr_SUMMARY )
327
#define attrGetALT( nod ) TY_(AttrGetById)( nod, TidyAttr_ALT )
328
#define attrGetLONGDESC( nod ) TY_(AttrGetById)( nod, TidyAttr_LONGDESC )
329
#define attrGetUSEMAP( nod ) TY_(AttrGetById)( nod, TidyAttr_USEMAP )
330
#define attrGetISMAP( nod ) TY_(AttrGetById)( nod, TidyAttr_ISMAP )
331
#define attrGetLANGUAGE( nod ) TY_(AttrGetById)( nod, TidyAttr_LANGUAGE )
332
#define attrGetTYPE( nod ) TY_(AttrGetById)( nod, TidyAttr_TYPE )
333
#define attrGetVALUE( nod ) TY_(AttrGetById)( nod, TidyAttr_VALUE )
334
#define attrGetCONTENT( nod ) TY_(AttrGetById)( nod, TidyAttr_CONTENT )
335
#define attrGetTITLE( nod ) TY_(AttrGetById)( nod, TidyAttr_TITLE )
336
#define attrGetXMLNS( nod ) TY_(AttrGetById)( nod, TidyAttr_XMLNS )
337
#define attrGetDATAFLD( nod ) TY_(AttrGetById)( nod, TidyAttr_DATAFLD )
338
#define attrGetWIDTH( nod ) TY_(AttrGetById)( nod, TidyAttr_WIDTH )
339
#define attrGetHEIGHT( nod ) TY_(AttrGetById)( nod, TidyAttr_HEIGHT )
340
#define attrGetFOR( nod ) TY_(AttrGetById)( nod, TidyAttr_FOR )
341
#define attrGetSELECTED( nod ) TY_(AttrGetById)( nod, TidyAttr_SELECTED )
342
#define attrGetCHECKED( nod ) TY_(AttrGetById)( nod, TidyAttr_CHECKED )
343
#define attrGetLANG( nod ) TY_(AttrGetById)( nod, TidyAttr_LANG )
344
#define attrGetTARGET( nod ) TY_(AttrGetById)( nod, TidyAttr_TARGET )
345
#define attrGetHTTP_EQUIV( nod ) TY_(AttrGetById)( nod, TidyAttr_HTTP_EQUIV )
346
#define attrGetREL( nod ) TY_(AttrGetById)( nod, TidyAttr_REL )
348
#define attrGetOnMOUSEMOVE( nod ) TY_(AttrGetById)( nod, TidyAttr_OnMOUSEMOVE )
349
#define attrGetOnMOUSEDOWN( nod ) TY_(AttrGetById)( nod, TidyAttr_OnMOUSEDOWN )
350
#define attrGetOnMOUSEUP( nod ) TY_(AttrGetById)( nod, TidyAttr_OnMOUSEUP )
351
#define attrGetOnCLICK( nod ) TY_(AttrGetById)( nod, TidyAttr_OnCLICK )
352
#define attrGetOnMOUSEOVER( nod ) TY_(AttrGetById)( nod, TidyAttr_OnMOUSEOVER )
353
#define attrGetOnMOUSEOUT( nod ) TY_(AttrGetById)( nod, TidyAttr_OnMOUSEOUT )
354
#define attrGetOnKEYDOWN( nod ) TY_(AttrGetById)( nod, TidyAttr_OnKEYDOWN )
355
#define attrGetOnKEYUP( nod ) TY_(AttrGetById)( nod, TidyAttr_OnKEYUP )
356
#define attrGetOnKEYPRESS( nod ) TY_(AttrGetById)( nod, TidyAttr_OnKEYPRESS )
357
#define attrGetOnFOCUS( nod ) TY_(AttrGetById)( nod, TidyAttr_OnFOCUS )
358
#define attrGetOnBLUR( nod ) TY_(AttrGetById)( nod, TidyAttr_OnBLUR )
360
#define attrGetBGCOLOR( nod ) TY_(AttrGetById)( nod, TidyAttr_BGCOLOR )
362
#define attrGetLINK( nod ) TY_(AttrGetById)( nod, TidyAttr_LINK )
363
#define attrGetALINK( nod ) TY_(AttrGetById)( nod, TidyAttr_ALINK )
364
#define attrGetVLINK( nod ) TY_(AttrGetById)( nod, TidyAttr_VLINK )
366
#define attrGetTEXT( nod ) TY_(AttrGetById)( nod, TidyAttr_TEXT )
367
#define attrGetSTYLE( nod ) TY_(AttrGetById)( nod, TidyAttr_STYLE )
368
#define attrGetABBR( nod ) TY_(AttrGetById)( nod, TidyAttr_ABBR )
369
#define attrGetCOLSPAN( nod ) TY_(AttrGetById)( nod, TidyAttr_COLSPAN )
370
#define attrGetFONT( nod ) TY_(AttrGetById)( nod, TidyAttr_FONT )
371
#define attrGetBASEFONT( nod ) TY_(AttrGetById)( nod, TidyAttr_BASEFONT )
372
#define attrGetROWSPAN( nod ) TY_(AttrGetById)( nod, TidyAttr_ROWSPAN )
399
374
#endif /* __ATTRS_H__ */