* 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)
| 6100 | * for other nodes, HTML_NA (no checks performed) |
| 6101 | */ |
| 6102 | htmlStatus |
| 6103 | htmlNodeStatus(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 * |
nothing calls this directly
no test coverage detected