2 /* $Id: xpath3.c,v 1.6 2006-03-31 15:58:10 adam Exp $
3 Copyright (C) 1995-2005
6 This file is part of the Zebra server.
8 Zebra is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with Zebra; see the file LICENSE.zebra. If not, write to the
20 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 #include "../api/testlib.h"
26 /** xpath3.c - attributes, with Danish characters */
28 const char *myrec[] = {
30 " <!-- Space in attribute --> \n"
31 " <first attr=\"danish\">content</first> \n"
32 " <second attr=\"danish lake\">content</second> \n"
33 " <!-- Oslash in Latin-1 encoded below.. --> \n"
34 " <third attr=\"dansk sø\">content<third> \n"
39 static void tst(int argc, char **argv)
41 ZebraService zs = tl_start_up(0, argc, argv);
42 ZebraHandle zh = zebra_open(zs, 0);
43 YAZ_CHECK(tl_init_data(zh, myrec));
45 YAZ_CHECK(tl_query(zh, "@attr 1=/root content",1));
46 YAZ_CHECK(tl_query(zh, "@attr 1=/root/first content",1));
47 YAZ_CHECK(tl_query(zh, "@attr {1=/root/first[@attr='danish']} content",1));
48 YAZ_CHECK(tl_query(zh, "@attr {1=/root/second[@attr='danish lake']} content",1));
49 YAZ_CHECK(tl_query(zh, "@attr {1=/root/third[@attr='dansk s\xc3\xb8']} content",1));
50 /* FIXME - This triggers bug200 */
52 YAZ_CHECK(tl_close_down(zh, zs));