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

Function htmlNodeStatus

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:6102–6122  ·  view source on GitHub ↗

* htmlNodeStatus: * @node: an htmlNodePtr in a tree * @legacy: whether to allow deprecated elements (YES is faster here * for Element nodes) * * Checks whether the tree node is valid. Experimental (the author * only uses the HTML enhancements in a SAX parser) * * Return: for Element nodes, a return from htmlElementAllowedHere (if * legacy allowed) or htmlElementStatusHere (otherwise)

Source from the content-addressed store, hash-verified

6100 * for other nodes, HTML_NA (no checks performed)
6101 */
6102htmlStatus
6103htmlNodeStatus(htmlNodePtr node, int legacy) {
6104 if ( ! node )
6105 return HTML_INVALID ;
6106
6107 switch ( node->type ) {
6108 case XML_ELEMENT_NODE:
6109 return legacy
6110 ? ( htmlElementAllowedHere (
6111 htmlTagLookup(node->parent->name) , node->name
6112 ) ? HTML_VALID : HTML_INVALID )
6113 : htmlElementStatusHere(
6114 htmlTagLookup(node->parent->name) ,
6115 htmlTagLookup(node->name) )
6116 ;
6117 case XML_ATTRIBUTE_NODE:
6118 return htmlAttrAllowed(
6119 htmlTagLookup(node->parent->name) , node->name, legacy) ;
6120 default: return HTML_NA ;
6121 }
6122}
6123/************************************************************************
6124 * *
6125 * New set (2.6.0) of simpler and more flexible APIs *

Callers

nothing calls this directly

Calls 4

htmlElementAllowedHereFunction · 0.85
htmlTagLookupFunction · 0.85
htmlElementStatusHereFunction · 0.85
htmlAttrAllowedFunction · 0.85

Tested by

no test coverage detected