From b43dc8a6733260d21bed0c343196dc41c754bd71 Mon Sep 17 00:00:00 2001 From: Pierre Wieser Date: Tue, 29 Nov 2011 21:15:34 +0100 Subject: [PATCH] NAXMLReader: only search for identifier in schema key --- ChangeLog | 5 +++++ src/io-xml/naxml-reader.c | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b274510..a1e0b354 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-29 Pierre Wieser + + * src/io-xml/naxml-reader.c (schema_parse_schema_content): + Only search for identifier in schema key. + 2011-11-28 Pierre Wieser * src/io-desktop/nadp-desktop-file.c (check_key_file): diff --git a/src/io-xml/naxml-reader.c b/src/io-xml/naxml-reader.c index 0bd6bb50..84a409f8 100644 --- a/src/io-xml/naxml-reader.c +++ b/src/io-xml/naxml-reader.c @@ -557,12 +557,12 @@ iter_on_list_children( NAXMLReader *reader, xmlNode *list ) } } - /* check that we have a not empty id + /* if we do not have any error, check that we have at least a not empty id */ if( code == IMPORTER_CODE_OK ){ if( !reader->private->item_id || !strlen( reader->private->item_id )){ na_core_utils_slist_add_message( &reader->private->parms->messages, ERR_ITEM_ID_NOT_FOUND ); - code = IMPORTER_CODE_NO_ITEM_ID; + code = IMPORTER_CODE_NO_ITEM_ID; } } @@ -980,12 +980,13 @@ schema_parse_schema_content( NAXMLReader *reader, xmlNode *schema ) str->reader_found = TRUE; /* set the item id the first time, check after + * - until v 2.0 of the exported schemas, both and + * has the id of the item (because there was one fake schema for + * each item) + * - starting with v 3, only key has this id */ - if( !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_KEY ) || - !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_APPLYTO )){ - + if( !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_APPLYTO )){ schema_check_for_id( reader, iter ); - if( !reader->private->node_ok ){ continue; } @@ -994,9 +995,7 @@ schema_parse_schema_content( NAXMLReader *reader, xmlNode *schema ) /* search for the type of the item */ if( !strxcmp( iter->name, NAXML_KEY_SCHEMA_NODE_APPLYTO )){ - schema_check_for_type( reader, iter ); - if( !reader->private->node_ok ){ continue; } @@ -1007,7 +1006,7 @@ schema_parse_schema_content( NAXMLReader *reader, xmlNode *schema ) } /* - * check the id on 'key' and 'applyto' keys + * check the id on 'applyto' key */ static void schema_check_for_id( NAXMLReader *reader, xmlNode *iter ) -- 2.11.4.GIT