• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/tidy-15.15/tidy/src/

Lines Matching +refs:xml +refs:node +refs:attributes

409 Bool TY_(FindTag)( TidyDocImpl* doc, Node *node )
414 node->tag = doc->tags.xml_tags;
418 if ( node->element && (np = lookup(&doc->tags, node->element)) )
420 node->tag = np;
438 Parser* TY_(FindParser)( TidyDocImpl* doc, Node *node )
440 const Dict* np = lookup( &doc->tags, node->element );
527 Dict* xml;
532 /* create dummy entry for all xml tags */
533 xml = (Dict*) MemAlloc( sizeof(Dict) );
534 ClearMemory( xml, sizeof(Dict) );
535 xml->name = NULL;
536 xml->versions = VERS_XML;
537 xml->model = CM_BLOCK;
538 xml->parser = NULL;
539 xml->chkattrs = NULL;
540 xml->attrvers = NULL;
541 tags->xml_tags = xml;
612 /* default method for checking an element's attributes */
613 void TY_(CheckAttributes)( TidyDocImpl* doc, Node *node )
615 AttVal *next, *attval = node->attributes;
619 TY_(CheckAttribute)( doc, node, attval );
624 /* methods for checking attributes for specific elements */
626 void CheckIMG( TidyDocImpl* doc, Node *node )
628 Bool HasAlt = TY_(AttrGetById)(node, TidyAttr_ALT) != NULL;
629 Bool HasSrc = TY_(AttrGetById)(node, TidyAttr_SRC) != NULL;
630 Bool HasUseMap = TY_(AttrGetById)(node, TidyAttr_USEMAP) != NULL;
631 Bool HasIsMap = TY_(AttrGetById)(node, TidyAttr_ISMAP) != NULL;
632 Bool HasDataFld = TY_(AttrGetById)(node, TidyAttr_DATAFLD) != NULL;
634 TY_(CheckAttributes)(doc, node);
641 TY_(ReportMissingAttr)( doc, node, "alt" );
645 TY_(AddAttribute)( doc, node, "alt", cfgStr(doc, TidyAltText) );
649 TY_(ReportMissingAttr)( doc, node, "src" );
654 TY_(ReportAttrError)( doc, node, NULL, MISSING_IMAGEMAP);
658 void CheckCaption(TidyDocImpl* doc, Node *node)
662 TY_(CheckAttributes)(doc, node);
664 attval = TY_(AttrGetById)(node, TidyAttr_ALIGN);
674 TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
677 void CheckHTML( TidyDocImpl* doc, Node *node )
679 TY_(CheckAttributes)(doc, node);
682 void CheckAREA( TidyDocImpl* doc, Node *node )
684 Bool HasAlt = TY_(AttrGetById)(node, TidyAttr_ALT) != NULL;
685 Bool HasHref = TY_(AttrGetById)(node, TidyAttr_HREF) != NULL;
686 Bool HasNohref = TY_(AttrGetById)(node, TidyAttr_NOHREF) != NULL;
688 TY_(CheckAttributes)(doc, node);
695 TY_(ReportMissingAttr)( doc, node, "alt" );
700 TY_(ReportMissingAttr)( doc, node, "href" );
703 void CheckTABLE( TidyDocImpl* doc, Node *node )
706 Bool HasSummary = TY_(AttrGetById)(node, TidyAttr_SUMMARY) != NULL;
708 TY_(CheckAttributes)(doc, node);
717 TY_(ReportMissingAttr)( doc, node, "summary");
722 if ( cfgBool(doc, TidyXmlOut) && (attval = TY_(AttrGetById)(node, TidyAttr_BORDER)) )
730 void CheckSCRIPT( TidyDocImpl* doc, Node *node )
735 TY_(CheckAttributes)(doc, node);
737 lang = TY_(AttrGetById)(node, TidyAttr_LANGUAGE);
738 type = TY_(AttrGetById)(node, TidyAttr_TYPE);
753 TY_(AddAttribute)(doc, node, "type", "text/javascript");
758 TY_(AddAttribute)(doc, node, "type", "text/vbscript");
763 TY_(AddAttribute)(doc, node, "type", "text/javascript");
766 type = TY_(AttrGetById)(node, TidyAttr_TYPE);
770 TY_(ReportAttrError)(doc, node, type, INSERTING_ATTRIBUTE);
774 TY_(ReportMissingAttr)(doc, node, "type");
781 void CheckSTYLE( TidyDocImpl* doc, Node *node )
783 AttVal *type = TY_(AttrGetById)(node, TidyAttr_TYPE);
785 TY_(CheckAttributes)( doc, node );
789 type = TY_(RepairAttrValue)(doc, node, "type", "text/css");
790 TY_(ReportAttrError)( doc, node, type, INSERTING_ATTRIBUTE );
795 void CheckLINK( TidyDocImpl* doc, Node *node )
797 AttVal *rel = TY_(AttrGetById)(node, TidyAttr_REL);
799 TY_(CheckAttributes)( doc, node );
804 AttVal *type = TY_(AttrGetById)(node, TidyAttr_TYPE);
807 TY_(AddAttribute)( doc, node, "type", "text/css" );
808 type = TY_(AttrGetById)(node, TidyAttr_TYPE);
809 TY_(ReportAttrError)( doc, node, type, INSERTING_ATTRIBUTE );
815 void CheckFORM( TidyDocImpl* doc, Node *node )
817 AttVal *action = TY_(AttrGetById)(node, TidyAttr_ACTION);
819 TY_(CheckAttributes)(doc, node);
822 TY_(ReportMissingAttr)(doc, node, "action");
826 void CheckMETA( TidyDocImpl* doc, Node *node )
828 AttVal *content = TY_(AttrGetById)(node, TidyAttr_CONTENT);
830 TY_(CheckAttributes)(doc, node);
833 TY_(ReportMissingAttr)( doc, node, "content" );
838 Bool TY_(nodeIsText)( Node* node )
840 return ( node && node->type == TextNode );
843 Bool TY_(nodeHasText)( TidyDocImpl* doc, Node* node )
845 if ( doc && node )
849 for ( ix = node->start; ix < node->end; ++ix )
859 Bool TY_(nodeIsElement)( Node* node )
861 return ( node &&
862 (node->type == StartTag || node->type == StartEndTag) );
869 Bool nodeMatchCM( Node* node, uint contentModel )
871 return ( node && node->tag &&
872 (node->tag->model & contentModel) == contentModel );
878 Bool TY_(nodeHasCM)( Node* node, uint contentModel )
880 return ( node && node->tag &&
881 (node->tag->model & contentModel) != 0 );
884 Bool TY_(nodeCMIsBlock)( Node* node )
886 return TY_(nodeHasCM)( node, CM_BLOCK );
888 Bool TY_(nodeCMIsInline)( Node* node )
890 return TY_(nodeHasCM)( node, CM_INLINE );
892 Bool TY_(nodeCMIsEmpty)( Node* node )
894 return TY_(nodeHasCM)( node, CM_EMPTY );
897 Bool TY_(nodeIsHeader)( Node* node )
899 TidyTagId tid = TagId( node );
909 uint TY_(nodeHeaderLevel)( Node* node )
911 TidyTagId tid = TagId( node );