From 55d680f049f456e25109a73445806b0b108b4ee4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 9 Jul 2008 10:58:14 +0200 Subject: [PATCH] Added test of DOM filter and use of input chain + snippets. --- test/xslt/Makefile.am | 5 ++ test/xslt/dcaddmeta.xsl | 17 +++++++ test/xslt/dctoindex.xsl | 62 +++++++++++++++++++++++++ test/xslt/dom1.c | 12 +++++ test/xslt/gpdctodc.xsl | 100 ++++++++++++++++++++++++++++++++++++++++ test/xslt/gutenberg-sample.xml | 35 ++++++++++++++ test/xslt/gutenberg.xml | 22 +++++++++ 7 files changed, 253 insertions(+) create mode 100644 test/xslt/dcaddmeta.xsl create mode 100644 test/xslt/dctoindex.xsl create mode 100644 test/xslt/gpdctodc.xsl create mode 100644 test/xslt/gutenberg-sample.xml create mode 100644 test/xslt/gutenberg.xml diff --git a/test/xslt/Makefile.am b/test/xslt/Makefile.am index 60c8351..052f1b6 100644 --- a/test/xslt/Makefile.am +++ b/test/xslt/Makefile.am @@ -14,6 +14,11 @@ EXTRA_DIST= \ dom-config-del.xml \ dom-brief.xsl \ dom-snippet.xsl \ + gutenberg.xml \ + gutenberg-sample.xml \ + dcaddmeta.xsl \ + gpdctodc.xsl \ + dctoindex.xsl \ del-col.xml \ id.xsl \ index.xsl \ diff --git a/test/xslt/dcaddmeta.xsl b/test/xslt/dcaddmeta.xsl new file mode 100644 index 0000000..c41a2f6 --- /dev/null +++ b/test/xslt/dcaddmeta.xsl @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/test/xslt/dctoindex.xsl b/test/xslt/dctoindex.xsl new file mode 100644 index 0000000..106c947 --- /dev/null +++ b/test/xslt/dctoindex.xsl @@ -0,0 +1,62 @@ + + + + + + + + |title|date|creator| + + |title|date|creator| + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/xslt/dom1.c b/test/xslt/dom1.c index ded19e5..d68ec7a 100644 --- a/test/xslt/dom1.c +++ b/test/xslt/dom1.c @@ -126,6 +126,18 @@ void tst(int argc, char **argv) YAZ_CHECK(tl_query(zh, "@attr 1=title 3", 1)); YAZ_CHECK(tl_query(zh, "@attr 1=title b", 1)); + zh = index_some(zs, "dom.gutenberg.xml", "gutenberg-sample.xml"); + YAZ_CHECK(tl_query(zh, "selected", 1)); + + YAZ_CHECK_EQ(tl_fetch_first_compare( + zh, "zebra::snippet", yaz_oid_recsyn_xml, + "\n" + " etext/1338\n" + " Project Gutenberg\n" + " Selected Prose of Oscar Wilde\n" + ""), + ZEBRA_OK); + zebra_close(zh); diff --git a/test/xslt/gpdctodc.xsl b/test/xslt/gpdctodc.xsl new file mode 100644 index 0000000..787364a --- /dev/null +++ b/test/xslt/gpdctodc.xsl @@ -0,0 +1,100 @@ + + + + + + + + + + + http://www.gutenberg.org/etext/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/xslt/gutenberg-sample.xml b/test/xslt/gutenberg-sample.xml new file mode 100644 index 0000000..ca90edc --- /dev/null +++ b/test/xslt/gutenberg-sample.xml @@ -0,0 +1,35 @@ + + + + + +]> + + + + &pg; + Selected Prose of Oscar Wilde + Preface by Robert Ross -- How They Struck a Contemporary -- The Quality of George Meredith -- Life in the Fallacious Model -- Life the Disciple -- Life the Plagiarist -- The Indispensable East -- The Influence of the Impressionists on Climate -- + Wilde, Oscar, 1854-1900 + Selected Prose of Oscar Wilde by Oscar Wilde + en + + + Essays + Short stories + + + PR + 1998-06-01 + + diff --git a/test/xslt/gutenberg.xml b/test/xslt/gutenberg.xml new file mode 100644 index 0000000..b2a8b4f --- /dev/null +++ b/test/xslt/gutenberg.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + -- 1.7.10.4