• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/tidy-15.12/tidy/src/

Lines Matching +defs:xml +defs:node +defs:attributes

23     - each node has 2 NULL-terminated strings.
637 node->type is one of these:
986 Bool xml = cfgBool(doc, TidyXmlTags);
989 if (!xml && TY_(IsUpper)(c))
994 if ((!xml && !TY_(IsNamechar)(c)) ||
995 (xml && !TY_(IsXMLNamechar)(c)))
999 if (!xml && TY_(IsUpper)(c))
1018 attributes are represented as a linked
1026 Node* node = (Node*) MemAlloc( sizeof(Node) );
1027 ClearMemory( node, sizeof(Node) );
1030 node->line = lexer->lines;
1031 node->column = lexer->columns;
1033 node->type = TextNode;
1034 return node;
1041 Node *node = TY_(NewNode)( lexer );
1043 node->start = lexer->lexsize;
1044 node->end = lexer->lexsize;
1048 node->parent = element->parent;
1049 node->type = element->type;
1050 node->closed = element->closed;
1051 node->implicit = element->implicit;
1052 node->tag = element->tag;
1053 node->element = TY_(tmbstrdup)( element->element );
1054 node->attributes = TY_(DupAttrs)( doc, element->attributes );
1056 return node;
1059 /* free node's attributes */
1060 void TY_(FreeAttrs)( TidyDocImpl* doc, Node *node )
1063 while ( node->attributes )
1065 AttVal *av = node->attributes;
1070 TY_(IsAnchorElement)(doc, node) )
1072 TY_(RemoveAnchorByNode)( doc, node );
1076 node->attributes = av->next;
1091 /* detach attribute from node
1093 void TY_(DetachAttribute)( Node *node, AttVal *attr )
1097 for ( av = node->attributes; av; av = av->next )
1104 node->attributes = attr->next;
1111 /* detach attribute from node then free it
1113 void TY_(RemoveAttribute)( TidyDocImpl* doc, Node *node, AttVal *attr )
1115 TY_(DetachAttribute)( node, attr );
1124 void TY_(FreeNode)( TidyDocImpl* doc, Node *node )
1126 while ( node )
1128 Node* next = node->next;
1130 TY_(FreeAttrs)( doc, node );
1131 TY_(FreeNode)( doc, node->content );
1132 MemFree( node->element );
1134 if (node->otext)
1135 MemFree(node->otext);
1137 if (RootNode != node->type)
1138 MemFree( node );
1140 node->content = NULL;
1142 node = next;
1147 void StoreOriginalTextInToken(TidyDocImpl* doc, Node* node, uint count)
1160 node->otext = doc->docIn->otextbuf;
1185 node->otext = buf1;
1195 Node *node = TY_(NewNode)( lexer );
1196 node->start = lexer->txtstart;
1197 node->end = lexer->txtend;
1198 return node;
1204 Node *node = TY_(NewNode)( lexer );
1205 node->start = lexer->lexsize;
1207 node->end = lexer->lexsize;
1208 return node;
1214 Node *node = TY_(NewNode)( lexer );
1215 node->start = lexer->lexsize;
1217 node->end = lexer->lexsize;
1218 return node;
1224 Node* node = TY_(NewNode)( lexer );
1225 node->type = type;
1226 node->element = TY_(tmbstrndup)( lexer->lexbuf + lexer->txtstart,
1228 node->start = lexer->txtstart;
1229 node->end = lexer->txtstart;
1232 TY_(FindTag)(doc, node);
1234 return node;
1240 Node* node = TY_(NewNode)(lexer);
1241 node->type = type;
1242 node->start = lexer->txtstart;
1243 node->end = lexer->txtend;
1245 StoreOriginalTextInToken(doc, node, 0);
1247 return node;
1281 Node* node;
1282 for ( node = (doc ? doc->root.content : NULL);
1283 node && node->type != DocTypeTag;
1284 node = node->next )
1286 return node;
1290 Node* TY_(FindContainer)( Node* node )
1292 for ( node = (node ? node->parent : NULL);
1293 node && TY_(nodeHasCM)(node, CM_INLINE);
1294 node = node->parent )
1297 return node;
1304 Node *node;
1305 for ( node = (doc ? doc->root.content : NULL);
1306 node && !nodeIsHTML(node);
1307 node = node->next )
1310 return node;
1316 Node *node;
1317 for ( node = (doc ? doc->root.content : NULL);
1318 node && !(node->type == XmlDecl);
1319 node = node->next )
1322 return node;
1328 Node *node = TY_(FindHTML)( doc );
1330 if ( node )
1332 for ( node = node->content;
1333 node && !nodeIsHEAD(node);
1334 node = node->next )
1338 return node;
1343 Node *node = TY_(FindHEAD)(doc);
1345 if (node)
1346 for (node = node->content;
1347 node && !nodeIsTITLE(node);
1348 node = node->next) {}
1350 return node;
1355 Node *node = ( doc ? doc->root.content : NULL );
1357 while ( node && !nodeIsHTML(node) )
1358 node = node->next;
1360 if (node == NULL)
1363 node = node->content;
1364 while ( node && !nodeIsBODY(node) && !nodeIsFRAMESET(node) )
1365 node = node->next;
1367 if ( node && nodeIsFRAMESET(node) )
1369 node = node->content;
1370 while ( node && !nodeIsNOFRAMES(node) )
1371 node = node->next;
1373 if ( node )
1375 node = node->content;
1376 while ( node && !nodeIsBODY(node) )
1377 node = node->next;
1381 return node;
1388 Node *node;
1401 for ( node = head->content; node; node = node->next )
1403 if ( nodeIsMETA(node) )
1405 attval = TY_(AttrGetById)(node, TidyAttr_NAME);
1409 attval = TY_(AttrGetById)(node, TidyAttr_CONTENT);
1427 node = TY_(InferredTag)(doc, TidyTag_META);
1428 TY_(AddAttribute)( doc, node, "name", "generator" );
1429 TY_(AddAttribute)( doc, node, "content", buf );
1430 TY_(InsertNodeAtStart)( head, node );
1513 ** <?xml version "1.0" ... ?> declaration, if any,
1706 /* ensure XML document starts with <?xml version="1.0"?> */
1710 Node* xml;
1717 xml = root->content;
1721 xml = TY_(NewNode)(lexer);
1722 xml->type = XmlDecl;
1724 TY_(InsertNodeBeforeElement)(root->content, xml);
1726 root->content = xml;
1729 version = TY_(GetAttrByName)(xml, "version");
1730 encoding = TY_(GetAttrByName)(xml, "encoding");
1742 TY_(AddAttribute)( doc, xml, "encoding", enc );
1746 TY_(AddAttribute)( doc, xml, "version", "1.0" );
1753 Node *node = TY_(NewNode)( lexer );
1758 node->type = StartTag;
1759 node->implicit = yes;
1760 node->element = TY_(tmbstrdup)(dict->name);
1761 node->tag = dict;
1762 node->start = lexer->txtstart;
1763 node->end = lexer->txtend;
1765 return node;
1768 static Bool ExpectsContent(Node *node)
1770 if (node->type != StartTag)
1774 if (node->tag == NULL)
1777 if (node->tag->model & CM_EMPTY)
1784 create a text node for the contents of
2051 AttVal *attributes = NULL;
2401 attributes = NULL;
2404 /* parse attributes, consuming closing ">" */
2410 attributes = ParseAttrs( doc, &isempty );
2416 lexer->token->attributes = attributes;
2565 if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "xml", 3) == 0 &&
2569 attributes = NULL;
2694 case LEX_XMLDECL: /* seen "<?xml" so look for "?>" */
2721 lexer->token->attributes = attributes;
2731 AddAttrToList( &attributes, av );
2749 lexer->token->attributes = attributes;
2883 Some people use ASP for to customize attributes
2885 This is a workaround for attributes, but won't
3223 embed element with script attributes where newlines
3448 an exception is made for Javascript attributes and the
3450 and for attributes starting with "<xml " as generated by
3455 !(TY_(tmbstrncmp)(lexer->lexbuf+start, "<xml ", 5) == 0)
3467 /* and prompts attributes unless --literal-attributes is set to yes */
3468 /* #994841 - Whitespace is removed from value attributes */
3553 void TY_(InsertAttributeAtEnd)( Node *node, AttVal *av )
3555 AddAttrToList(&node->attributes, av);
3558 void TY_(InsertAttributeAtStart)( Node *node, AttVal *av )
3560 av->next = node->attributes;
3561 node->attributes = av;
3582 /* check if attributes are created by ASP markup */
3591 /* check if attributes are created by PHP markup */
3657 Node* node = TY_(NewNode)(lexer);
3658 node->type = DocTypeTag;
3659 node->start = lexer->txtstart;
3660 node->end = lexer->txtend;
3719 node->end = --(lexer->lexsize);
3721 si = TY_(GetAttrByName)(node, "SYSTEM");
3723 TY_(CheckUrl)(doc, node, si);
3725 if (!node->element || !IsValidXMLElemName(node->element))
3728 TY_(FreeNode)(doc, node);
3732 StoreOriginalTextInToken(doc, node, 0);
3734 return node;
3745 node->element = TY_(tmbstrndup)(lexer->lexbuf + start,
3785 AttVal* att = TY_(AddAttribute)(doc, node, hasfpi ? "PUBLIC" : "SYSTEM", value);
3802 TY_(InsertNodeAtEnd)(node, subset);
3811 TY_(FreeNode)(doc, node);