-/* $Id: d1_map.c,v 1.12 2006-07-06 11:40:23 adam Exp $
- Copyright (C) 1995-2005
+/* $Id: d1_map.c,v 1.16 2007-04-16 08:44:31 adam Exp $
+ Copyright (C) 1995-2007
Index Data ApS
This file is part of the Zebra server.
for more details.
You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
*/
#include <stdio.h>
#include <string.h>
#include <yaz/log.h>
-#include <yaz/oid.h>
+#include <yaz/oid_db.h>
#include <yaz/readconf.h>
#include <yaz/tpath.h>
#include <d1_absyn.h>
return 0;
res->name = 0;
- res->target_absyn_ref = VAL_NONE;
+ res->oid = 0;
res->map = 0;
mapp = &res->map;
res->next = 0;
file, lineno);
continue;
}
- if ((res->target_absyn_ref = oid_getvalbyname(argv[1]))
- == VAL_NONE)
+ res->oid = yaz_string_to_oid_nmem(yaz_oid_std(),
+ CLASS_RECSYN, argv[1], mem);
+ if (!res->oid)
{
yaz_log(YLOG_WARN, "%s:%d: Unknown reference '%s'",
file, lineno, argv[1]);
yaz_log(YLOG_WARN, "%s: Failed to load target absyn '%s'",
map->name, map->target_absyn_name);
}
- if (data1_is_xmlmode(dh))
- {
- n = n->child;
- if (!n)
- return 0;
- res1 = data1_mk_tag (dh, m, map->target_absyn_name, 0, res);
- }
- else
- res1 = res;
-
+ n = n->child;
+ if (!n)
+ return 0;
+ res1 = data1_mk_tag (dh, m, map->target_absyn_name, 0, res);
+ while (n && n->which != DATA1N_tag)
+ n = n->next;
if (map_children(dh, n, map, res1, m) < 0)
- {
return 0;
- }
return res;
}