if (list_of)
{
- if (!g_hash_table_lookup (state->schema_table, list_of))
+ SchemaState *tmp;
+
+ if (!(tmp = g_hash_table_lookup (state->schema_table, list_of)))
{
g_set_error (error, G_MARKUP_ERROR,
G_MARKUP_ERROR_INVALID_CONTENT,
"existing schema '%s'"), id, list_of);
return;
}
+
+ if (tmp->path)
+ {
+ g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+ _("Can not be a list of a schema with a path"));
+ return;
+ }
}
if (extends)
{
+ if (extends->path)
+ {
+ g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+ _("Can not extend a schema with a path"));
+ return;
+ }
+
if (list_of)
{
if (extends->list_of == NULL)
return;
}
+ if (path && list_of && !g_str_has_suffix (path, ":/"))
+ {
+ g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
+ _("the path of a list must end with ':/'"));
+ return;
+ }
+
state->schema_state = schema_state_new (path, gettext_domain,
extends, extends_name, list_of);
g_hash_table_insert (state->schema_table, g_strdup (id),