From 56446925bc29dd3770463b5f969a3a8470e27f26 Mon Sep 17 00:00:00 2001
From: David Maus <maus@hab.de>
Date: Mon, 26 Mar 2018 11:45:00 +0200
Subject: [PATCH] d:uuid-event ausfaktorisiert

---
 src/xproc/publish.xpl | 13 +------------
 src/xproc/uuid.xpl    | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 12 deletions(-)
 create mode 100644 src/xproc/uuid.xpl

diff --git a/src/xproc/publish.xpl b/src/xproc/publish.xpl
index c2501b3..f4f27f8 100644
--- a/src/xproc/publish.xpl
+++ b/src/xproc/publish.xpl
@@ -7,18 +7,7 @@
   <p:option name="objectId"  required="true"/>
   <p:option name="targetUri" required="true"/>
 
-  <p:declare-step type="d:uuid-event">
-    <p:input  port="source"/>
-    <p:output port="result"/>
-    <p:option name="event" required="true"/>
-
-    <p:add-attribute attribute-value="" match="uuid">
-      <p:with-option name="attribute-name" select="$event"/>
-    </p:add-attribute>
-    <p:uuid version="4">
-      <p:with-option name="match" select="concat('@', $event)"/>
-    </p:uuid>
-  </p:declare-step>
+  <p:import href="uuid.xpl"/>
 
   <p:declare-step type="d:uuid-source">
     <p:output port="result"/>
diff --git a/src/xproc/uuid.xpl b/src/xproc/uuid.xpl
new file mode 100644
index 0000000..eea2293
--- /dev/null
+++ b/src/xproc/uuid.xpl
@@ -0,0 +1,18 @@
+<p:library version="1.0"
+           xmlns:p="http://www.w3.org/ns/xproc"
+           xmlns:d="http://dmaus.name/ns/xproc">
+
+  <p:declare-step type="d:uuid-event">
+    <p:input  port="source"/>
+    <p:output port="result"/>
+    <p:option name="event" required="true"/>
+
+    <p:add-attribute attribute-value="" match="uuid">
+      <p:with-option name="attribute-name" select="$event"/>
+    </p:add-attribute>
+    <p:uuid version="4">
+      <p:with-option name="match" select="concat('@', $event)"/>
+    </p:uuid>
+  </p:declare-step>
+
+</p:library>
-- 
GitLab