Added accept and reject processors and ACCEPT target
authorSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 14 Sep 2009 02:34:14 +0000 (02:34 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Mon, 14 Sep 2009 02:34:14 +0000 (02:34 +0000)
sfatables/targets/ACCEPT.xml [new file with mode: 0644]
sfatables/targets/accept.xsl [new file with mode: 0644]
sfatables/targets/reject.xsl [new file with mode: 0644]

diff --git a/sfatables/targets/ACCEPT.xml b/sfatables/targets/ACCEPT.xml
new file mode 100644 (file)
index 0000000..7a8968e
--- /dev/null
@@ -0,0 +1,8 @@
+<target name="ACCEPT">
+    <!-- The context is empty, since this target does not require any input from SFA -->
+    <context select=""/>
+    <attributes>
+        <attribute terminal="yes"/>
+    </attributes>
+    <processor filename="accept.xsl"/>
+</target>
diff --git a/sfatables/targets/accept.xsl b/sfatables/targets/accept.xsl
new file mode 100644 (file)
index 0000000..9a397ef
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <!-- Magic sauce copied from a manual. This fragment basically copies everything except for
+    stuff that explicitly matches with the templates defined below. In the case of such a match,
+    the matched node is treated differently.-->
+    <xsl:template match="@* | node()">
+        <xsl:copy>
+            <xsl:apply-templates select="@* | node()"/>
+        </xsl:copy>
+    </xsl:template>
+    <xsl:template match="sfatables-input"/>
+</xsl:stylesheet>
diff --git a/sfatables/targets/reject.xsl b/sfatables/targets/reject.xsl
new file mode 100644 (file)
index 0000000..0c07e5e
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:template match="/">
+<sfa-verdict>
+    Your resource-allocation request has been rejected. 
+</sfa-verdict>
+    </xsl:template>
+</xsl:stylesheet>