MCPcopy Create free account
hub / github.com/Kitware/VTK / htmlAttrAllowed

Function htmlAttrAllowed

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:6064–6087  ·  view source on GitHub ↗

* htmlAttrAllowed: * @elt: HTML element * @attr: HTML attribute * @legacy: whether to allow deprecated attributes * * Checks whether an attribute is valid for an element * Has full knowledge of Required and Deprecated attributes * * Returns one of HTML_REQUIRED, HTML_VALID, HTML_DEPRECATED, HTML_INVALID */

Source from the content-addressed store, hash-verified

6062 * Returns one of HTML_REQUIRED, HTML_VALID, HTML_DEPRECATED, HTML_INVALID
6063 */
6064htmlStatus
6065htmlAttrAllowed(const htmlElemDesc* elt, const xmlChar* attr, int legacy) {
6066 const char** p ;
6067
6068 if ( !elt || ! attr )
6069 return HTML_INVALID ;
6070
6071 if ( elt->attrs_req )
6072 for ( p = elt->attrs_req; *p; ++p)
6073 if ( !xmlStrcmp((const xmlChar*)*p, attr) )
6074 return HTML_REQUIRED ;
6075
6076 if ( elt->attrs_opt )
6077 for ( p = elt->attrs_opt; *p; ++p)
6078 if ( !xmlStrcmp((const xmlChar*)*p, attr) )
6079 return HTML_VALID ;
6080
6081 if ( legacy && elt->attrs_depr )
6082 for ( p = elt->attrs_depr; *p; ++p)
6083 if ( !xmlStrcmp((const xmlChar*)*p, attr) )
6084 return HTML_DEPRECATED ;
6085
6086 return HTML_INVALID ;
6087}
6088/**
6089 * htmlNodeStatus:
6090 * @node: an htmlNodePtr in a tree

Callers 1

htmlNodeStatusFunction · 0.85

Calls 1

xmlStrcmpFunction · 0.85

Tested by

no test coverage detected