--- embedaddon/libxml2/relaxng.c 2013/07/22 01:22:18 1.1.1.2 +++ embedaddon/libxml2/relaxng.c 2014/06/15 19:53:31 1.1.1.3 @@ -39,9 +39,10 @@ static const xmlChar *xmlRelaxNGNs = (const xmlChar *) "http://relaxng.org/ns/structure/1.0"; -#define IS_RELAXNG(node, type) \ +#define IS_RELAXNG(node, typ) \ ((node != NULL) && (node->ns != NULL) && \ - (xmlStrEqual(node->name, (const xmlChar *) type)) && \ + (node->type == XML_ELEMENT_NODE) && \ + (xmlStrEqual(node->name, (const xmlChar *) typ)) && \ (xmlStrEqual(node->ns->href, xmlRelaxNGNs))) @@ -60,7 +61,7 @@ static const xmlChar *xmlRelaxNGNs = (const xmlChar *) #define DEBUG_LIST 1 -#define DEBUG_INCLUDE 1 +#define DEBUG_INCLUDE 1 #define DEBUG_ERROR 1 @@ -71,7 +72,7 @@ static const xmlChar *xmlRelaxNGNs = (const xmlChar *) #define MAX_ERROR 5 -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -421,7 +422,7 @@ struct _xmlRelaxNGDocument { /************************************************************************ * * - * Some factorized error routines * + * Some factorized error routines * * * ************************************************************************/ @@ -564,9 +565,9 @@ xmlRngVErr(xmlRelaxNGValidCtxtPtr ctxt, xmlNodePtr nod } /************************************************************************ - * * - * Preliminary type checking interfaces * - * * + * * + * Preliminary type checking interfaces * + * * ************************************************************************/ /** @@ -654,9 +655,9 @@ struct _xmlRelaxNGTypeLibrary { }; /************************************************************************ - * * - * Allocation functions * - * * + * * + * Allocation functions * + * * ************************************************************************/ static void xmlRelaxNGFreeGrammar(xmlRelaxNGGrammarPtr grammar); static void xmlRelaxNGFreeDefine(xmlRelaxNGDefinePtr define); @@ -1397,9 +1398,9 @@ xmlRelaxNGFreeValidState(xmlRelaxNGValidCtxtPtr ctxt, } /************************************************************************ - * * - * Semi internal functions * - * * + * * + * Semi internal functions * + * * ************************************************************************/ /** @@ -1429,9 +1430,9 @@ xmlRelaxParserSetFlag(xmlRelaxNGParserCtxtPtr ctxt, in } /************************************************************************ - * * - * Document functions * - * * + * * + * Document functions * + * * ************************************************************************/ static xmlDocPtr xmlRelaxNGCleanupDoc(xmlRelaxNGParserCtxtPtr ctxt, xmlDocPtr doc); @@ -2007,9 +2008,9 @@ xmlRelaxNGLoadExternalRef(xmlRelaxNGParserCtxtPtr ctxt } /************************************************************************ - * * - * Error functions * - * * + * * + * Error functions * + * * ************************************************************************/ #define VALID_ERR(a) xmlRelaxNGAddValidError(ctxt, a, NULL, NULL, 0); @@ -2360,7 +2361,7 @@ xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt, * generate the error directly */ if (((ctxt->flags & FLAGS_IGNORABLE) == 0) || - (ctxt->flags & FLAGS_NEGATIVE)) { + (ctxt->flags & FLAGS_NEGATIVE)) { xmlNodePtr node, seq; /* @@ -2390,9 +2391,9 @@ xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt, /************************************************************************ - * * - * Type library hooks * - * * + * * + * Type library hooks * + * * ************************************************************************/ static xmlChar *xmlRelaxNGNormalize(xmlRelaxNGValidCtxtPtr ctxt, const xmlChar * str); @@ -2847,12 +2848,12 @@ xmlRelaxNGCleanupTypes(void) } /************************************************************************ - * * - * Compiling element content into regexp * - * * + * * + * Compiling element content into regexp * + * * * Sometime the element content can be compiled into a pure regexp, * * This allows a faster execution and streamability at that level * - * * + * * ************************************************************************/ /* from automata.c but not exported */ @@ -3325,9 +3326,9 @@ xmlRelaxNGTryCompile(xmlRelaxNGParserCtxtPtr ctxt, xml } /************************************************************************ - * * - * Parsing functions * - * * + * * + * Parsing functions * + * * ************************************************************************/ static xmlRelaxNGDefinePtr xmlRelaxNGParseAttribute(xmlRelaxNGParserCtxtPtr @@ -6705,9 +6706,9 @@ xmlRelaxNGParseDocument(xmlRelaxNGParserCtxtPtr ctxt, } /************************************************************************ - * * - * Reading RelaxNGs * - * * + * * + * Reading RelaxNGs * + * * ************************************************************************/ /** @@ -7521,7 +7522,7 @@ xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt) xmlRngPErr(ctxt, (xmlNodePtr) doc, XML_RNGP_EMPTY, "xmlRelaxNGParse: %s is empty\n", (ctxt->URL ? ctxt->URL : BAD_CAST "schemas"), NULL); - + xmlFreeDoc(ctxt->document); ctxt->document = NULL; return (NULL); @@ -7663,9 +7664,9 @@ xmlRelaxNGSetParserStructuredErrors(xmlRelaxNGParserCt #ifdef LIBXML_OUTPUT_ENABLED /************************************************************************ - * * - * Dump back a compiled form * - * * + * * + * Dump back a compiled form * + * * ************************************************************************/ static void xmlRelaxNGDumpDefine(FILE * output, xmlRelaxNGDefinePtr define); @@ -7806,7 +7807,7 @@ xmlRelaxNGDumpDefine(FILE * output, xmlRelaxNGDefinePt * xmlRelaxNGDumpGrammar: * @output: the file output * @grammar: a grammar structure - * @top: is this a top grammar + * @top: is this a top grammar * * Dump a RelaxNG structure back */ @@ -7899,9 +7900,9 @@ xmlRelaxNGDumpTree(FILE * output, xmlRelaxNGPtr schema #endif /* LIBXML_OUTPUT_ENABLED */ /************************************************************************ - * * - * Validation of compiled content * - * * + * * + * Validation of compiled content * + * * ************************************************************************/ static int xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt, xmlRelaxNGDefinePtr define); @@ -8044,9 +8045,9 @@ xmlRelaxNGValidateCompiledContent(xmlRelaxNGValidCtxtP } /************************************************************************ - * * - * Progressive validation of when possible * - * * + * * + * Progressive validation of when possible * + * * ************************************************************************/ static int xmlRelaxNGValidateAttributeList(xmlRelaxNGValidCtxtPtr ctxt, xmlRelaxNGDefinePtr defines); @@ -8346,7 +8347,7 @@ xmlRelaxNGValidatePushElement(xmlRelaxNGValidCtxtPtr c * xmlRelaxNGValidatePushCData: * @ctxt: the RelaxNG validation context * @data: some character data read - * @len: the lenght of the data + * @len: the length of the data * * check the CData parsed for validation in the current stack * @@ -8480,9 +8481,9 @@ xmlRelaxNGValidateFullElement(xmlRelaxNGValidCtxtPtr c } /************************************************************************ - * * - * Generic interpreted validation implementation * - * * + * * + * Generic interpreted validation implementation * + * * ************************************************************************/ static int xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt, xmlRelaxNGDefinePtr define); @@ -10842,9 +10843,9 @@ xmlRelaxNGCleanPSVI(xmlNodePtr node) { return; } /************************************************************************ - * * - * Validation interfaces * - * * + * * + * Validation interfaces * + * * ************************************************************************/ /**