xmlAutomataStatePtr end;
xmlAutomataStatePtr state;
- xmlDictPtr dict; /* dictionary for interned string names */
+ xmlDictPtr dict; /* dictionnary for interned string names */
xmlSchemaTypePtr ctxtType; /* The current context simple/complex type */
int options;
xmlSchemaValidCtxtPtr vctxt;
static void
xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt,
const char *funcName,
- const char *message) LIBXML_ATTR_FORMAT(3,0);
+ const char *message);
static int
xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr ctxt,
xmlSchemaTypePtr type,
}
FREE_AND_NULL(str)
- return (xmlEscapeFormatString(buf));
+ return (*buf);
}
/**
*
* Handle a parser error
*/
-static void LIBXML_ATTR_FORMAT(4,0)
+static void
xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
const char *msg, const xmlChar * str1, const xmlChar * str2)
{
*
* Handle a parser error
*/
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
xmlNodePtr child, int error,
const char *msg, const xmlChar * str1, const xmlChar * str2)
*
* Handle a parser error
*/
-static void LIBXML_ATTR_FORMAT(7,0)
+static void
xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
const xmlChar * strData1, const xmlChar * strData2,
const xmlChar * strData3, const char *msg, const xmlChar * str1,
extra);
}
-static void LIBXML_ATTR_FORMAT(2,0)
+static void
xmlSchemaPSimpleInternalErr(xmlNodePtr node,
const char *msg, const xmlChar *str)
{
#define WXS_ERROR_TYPE_ERROR 1
#define WXS_ERROR_TYPE_WARNING 2
/**
- * xmlSchemaErr4Line:
+ * xmlSchemaErr3:
* @ctxt: the validation context
- * @errorLevel: the error level
- * @error: the error code
* @node: the context node
- * @line: the line number
+ * @error: the error code
* @msg: the error message
* @str1: extra data
* @str2: extra data
* @str3: extra data
- * @str4: extra data
*
* Handle a validation error
*/
-static void LIBXML_ATTR_FORMAT(6,0)
+static void
xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
xmlErrorLevel errorLevel,
int error, xmlNodePtr node, int line, const char *msg,
*
* Handle a validation error
*/
-static void LIBXML_ATTR_FORMAT(4,0)
+static void
xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
int error, xmlNodePtr node, const char *msg,
const xmlChar *str1, const xmlChar *str2, const xmlChar *str3)
msg, str1, str2, str3, NULL);
}
-static void LIBXML_ATTR_FORMAT(4,0)
+static void
xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
int error, xmlNodePtr node, const char *msg,
const xmlChar *str1, const xmlChar *str2,
msg, str1, str2, str3, str4);
}
-static void LIBXML_ATTR_FORMAT(4,0)
+static void
xmlSchemaErr(xmlSchemaAbstractCtxtPtr actxt,
int error, xmlNodePtr node, const char *msg,
const xmlChar *str1, const xmlChar *str2)
/*
* Don't try to format other nodes than element and
* attribute nodes.
- * Play safe and return an empty string.
+ * Play save and return an empty string.
*/
*msg = xmlStrdup(BAD_CAST "");
return(*msg);
TODO
return (NULL);
}
-
- /*
- * xmlSchemaFormatItemForReport() also returns an escaped format
- * string, so do this before calling it below (in the future).
- */
- xmlEscapeFormatString(msg);
-
/*
* VAL TODO: The output of the given schema component is currently
* disabled.
return (*msg);
}
-static void LIBXML_ATTR_FORMAT(3,0)
+static void
xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt,
const char *funcName,
const char *message,
if (actxt == NULL)
return;
- msg = xmlStrdup(BAD_CAST "Internal error: %s, ");
+ msg = xmlStrdup(BAD_CAST "Internal error: ");
+ msg = xmlStrcat(msg, BAD_CAST funcName);
+ msg = xmlStrcat(msg, BAD_CAST ", ");
msg = xmlStrcat(msg, BAD_CAST message);
msg = xmlStrcat(msg, BAD_CAST ".\n");
if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR)
- xmlSchemaErr3(actxt, XML_SCHEMAV_INTERNAL, NULL,
- (const char *) msg, (const xmlChar *) funcName, str1, str2);
+ xmlSchemaErr(actxt, XML_SCHEMAV_INTERNAL, NULL,
+ (const char *) msg, str1, str2);
+
else if (actxt->type == XML_SCHEMA_CTXT_PARSER)
- xmlSchemaErr3(actxt, XML_SCHEMAP_INTERNAL, NULL,
- (const char *) msg, (const xmlChar *) funcName, str1, str2);
+ xmlSchemaErr(actxt, XML_SCHEMAP_INTERNAL, NULL,
+ (const char *) msg, str1, str2);
FREE_AND_NULL(msg)
}
-static void LIBXML_ATTR_FORMAT(3,0)
+static void
xmlSchemaInternalErr(xmlSchemaAbstractCtxtPtr actxt,
const char *funcName,
const char *message)
}
#if 0
-static void LIBXML_ATTR_FORMAT(3,0)
+static void
xmlSchemaPInternalErr(xmlSchemaParserCtxtPtr pctxt,
const char *funcName,
const char *message,
}
#endif
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt,
xmlParserErrors error,
xmlNodePtr node,
FREE_AND_NULL(msg)
}
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt,
xmlParserErrors error,
xmlNodePtr node,
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt,
xmlParserErrors error,
xmlNodePtr node,
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt,
xmlParserErrors error,
xmlSchemaPSVIIDCNodePtr idcNode,
msg = xmlStrcat(msg, BAD_CAST " '");
if (type->builtInType != 0) {
msg = xmlStrcat(msg, BAD_CAST "xs:");
- str = xmlStrdup(type->name);
- } else {
- const xmlChar *qName = xmlSchemaFormatQName(&str, type->targetNamespace, type->name);
- if (!str)
- str = xmlStrdup(qName);
- }
- msg = xmlStrcat(msg, xmlEscapeFormatString(&str));
+ msg = xmlStrcat(msg, type->name);
+ } else
+ msg = xmlStrcat(msg,
+ xmlSchemaFormatQName(&str,
+ type->targetNamespace, type->name));
msg = xmlStrcat(msg, BAD_CAST "'");
FREE_AND_NULL(str);
}
FREE_AND_NULL(msg)
}
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
xmlParserErrors error,
xmlNodePtr node,
str = xmlStrcat(str, BAD_CAST ", ");
}
str = xmlStrcat(str, BAD_CAST " ).\n");
- msg = xmlStrcat(msg, xmlEscapeFormatString(&str));
+ msg = xmlStrcat(msg, BAD_CAST str);
FREE_AND_NULL(str)
} else
msg = xmlStrcat(msg, BAD_CAST "\n");
xmlFree(msg);
}
-static void LIBXML_ATTR_FORMAT(8,0)
+static void
xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
xmlParserErrors error,
xmlNodePtr node,
*
* Reports an error during parsing.
*/
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaPCustomErrExt(xmlSchemaParserCtxtPtr ctxt,
xmlParserErrors error,
xmlSchemaBasicItemPtr item,
*
* Reports an error during parsing.
*/
-static void LIBXML_ATTR_FORMAT(5,0)
+static void
xmlSchemaPCustomErr(xmlSchemaParserCtxtPtr ctxt,
xmlParserErrors error,
xmlSchemaBasicItemPtr item,
*
* Reports an attribute use error during parsing.
*/
-static void LIBXML_ATTR_FORMAT(6,0)
+static void
xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
xmlParserErrors error,
xmlNodePtr node,
* Reports a simple type validation error.
* TODO: Should this report the value of an element as well?
*/
-static void LIBXML_ATTR_FORMAT(8,0)
+static void
xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
xmlParserErrors error,
xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED,
msg = xmlStrcat(msg, BAD_CAST " '");
if (type->builtInType != 0) {
msg = xmlStrcat(msg, BAD_CAST "xs:");
- str = xmlStrdup(type->name);
- } else {
- const xmlChar *qName = xmlSchemaFormatQName(&str, type->targetNamespace, type->name);
- if (!str)
- str = xmlStrdup(qName);
- }
- msg = xmlStrcat(msg, xmlEscapeFormatString(&str));
+ msg = xmlStrcat(msg, type->name);
+ } else
+ msg = xmlStrcat(msg,
+ xmlSchemaFormatQName(&str,
+ type->targetNamespace, type->name));
msg = xmlStrcat(msg, BAD_CAST "'.");
FREE_AND_NULL(str);
}
}
if (expected) {
msg = xmlStrcat(msg, BAD_CAST " Expected is '");
- xmlChar *expectedEscaped = xmlCharStrdup(expected);
- msg = xmlStrcat(msg, xmlEscapeFormatString(&expectedEscaped));
- FREE_AND_NULL(expectedEscaped);
+ msg = xmlStrcat(msg, BAD_CAST expected);
msg = xmlStrcat(msg, BAD_CAST "'.\n");
} else
msg = xmlStrcat(msg, BAD_CAST "\n");
else
goto pattern_and_enum;
}
-
/*
* Whitespace handling is only of importance for string-based
* types.
ws = xmlSchemaGetWhiteSpaceFacetValue(type);
} else
ws = XML_SCHEMA_WHITESPACE_COLLAPSE;
-
/*
* If the value was not computed (for string or
* anySimpleType based types), then use the provided
* type.
*/
- if (val != NULL)
+ if (val == NULL)
+ valType = valType;
+ else
valType = xmlSchemaGetValType(val);
ret = 0;
if (xmlNewProp(defAttrOwnerElem,
iattr->localName, value) == NULL) {
VERROR_INT("xmlSchemaVAttributesComplex",
- "calling xmlNewProp()");
+ "callling xmlNewProp()");
if (normValue != NULL)
xmlFree(normValue);
goto internal_error;
for (j = 0, i = 0; i < nb_attributes; i++, j += 5) {
/*
- * Duplicate the value, changing any & to a literal ampersand.
- *
- * libxml2 differs from normal SAX here in that it escapes all ampersands
- * as & instead of delivering the raw converted string. Changing the
- * behavior at this point would break applications that use this API, so
- * we are forced to work around it. There is no danger of accidentally
- * decoding some entity other than & in this step because without
- * unescaped ampersands there can be no other entities in the string.
+ * Duplicate the value.
*/
- value = xmlStringLenDecodeEntities(vctxt->parserCtxt, attributes[j+3],
- attributes[j+4] - attributes[j+3], XML_SUBSTITUTE_REF, 0, 0, 0);
+ value = xmlStrndup(attributes[j+3],
+ attributes[j+4] - attributes[j+3]);
/*
* TODO: Set the node line.
*/