llow EXSLT to be used if it's available.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 8 Oct 2007 11:47:20 +0000 (11:47 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 8 Oct 2007 11:47:20 +0000 (11:47 +0000)
NEWS
etc/Makefile.am
etc/config.xml
etc/exslttest.xsl [new file with mode: 0644]
src/yaz-proxy-main.cpp

diff --git a/NEWS b/NEWS
index 09c5bbe..2b0efaa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+Allow EXSLT to be used if it's available.
+
 --- 1.3.0 2007/05/09
 
 Debian packages libyazproxy2, libyazproxy2-dev. These depend on
index 533157e..7d73ff5 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.7 2006-08-14 09:26:02 adam Exp $
+# $Id: Makefile.am,v 1.8 2007-10-08 11:47:20 adam Exp $
 
 proxydatadir=$(datadir)/yazproxy
 proxydata_DATA = \
@@ -8,6 +8,7 @@ proxydata_DATA = \
  MARC21slim2MODS3.xsl \
  MARC21slim2RDFDC.xsl \
  MARC21slimUtils.xsl \
+ exslttest.xsl \
  config.xml \
  explain.xml \
  voyager.xml \
index 6228571..ca243e0 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!-- $Id: config.xml,v 1.20 2006-04-12 11:55:38 adam Exp $ -->
+<!-- $Id: config.xml,v 1.21 2007-10-08 11:47:20 adam Exp $ -->
 <proxy xmlns="http://indexdata.dk/yazproxy/schema/0.9/"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       <title>Dublin Core</title>
       <name>dc</name>
     </syntax>
+    <syntax type="xml" marcxml="1" stylesheet="exslttest.xsl">
+      <title>EXSLT Test</title>
+      <name>exslt</name>
+    </syntax>
+    
     <syntax type="*" error="238"/>
     <preinit>2</preinit>
     <xi:include href="explain.xml"/>
diff --git a/etc/exslttest.xsl b/etc/exslttest.xsl
new file mode 100644 (file)
index 0000000..27dcf2c
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0" 
+                xmlns:date="http://exslt.org/dates-and-times" 
+                extension-element-prefixes="date">
+  
+  <xsl:output media-type="text/xml" 
+              indent="yes" method="xml" encoding="UTF-8" />
+
+  <xsl:template match="/">
+    <daterec>
+      <xsl:copy-of select="."/>
+      <date>
+       <xsl:value-of select="date:date()"/> 
+      </date>
+    </daterec>
+  </xsl:template>
+</xsl:stylesheet>
index 84bd47c..aa6b7c0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: yaz-proxy-main.cpp,v 1.20 2006-07-06 11:50:26 adam Exp $
+/* $Id: yaz-proxy-main.cpp,v 1.21 2007-10-08 11:47:21 adam Exp $
    Copyright (c) 1998-2006, Index Data.
 
 This file is part of the yazproxy.
@@ -56,6 +56,10 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <libxslt/transform.h>
 #endif
 
+#if YAZ_HAVE_EXSLT
+#include <libexslt/exslt.h>
+#endif
+
 using namespace yazpp_1;
 
 void usage(char *prog)
@@ -209,6 +213,10 @@ static void child_run(SocketManager *m, int run)
     xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
     xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
 #endif
+
+#if YAZ_HAVE_EXSLT
+    exsltRegisterAll();
+#endif
 #ifdef WIN32
 #else
     yaz_log(YLOG_LOG, "0 proxy run=%d pid=%ld", run, (long) getpid());