severity 448205 wishlist
tags 448205 + patch
kthxbye

I created a patch to implement the saxon:systemId function. It has been tested and works with the DocBook stylesheets. The patch is attached and should be applied to saxon.c in the libexslt directory.

--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
a typesetting engine: http://crustytoothpaste.ath.cx/~bmc/code/thwack
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
--- saxon.c.orig	2007-10-26 23:00:56.000000000 +0000
+++ saxon.c	2007-10-26 23:21:39.000000000 +0000
@@ -180,6 +180,25 @@
 }
 
 /**
+ * exsltSaxonSystemIdFunction:
+ * @ctxt:  an XPath parser context
+ * @nargs: number of arguments
+ *
+ * Implements the SAXON systemId() function
+ *     string saxon:systemId ()
+ * This function returns the system ID of the document being styled.
+ */
+static void
+exsltSaxonSystemIdFunction (xmlXPathParserContextPtr ctxt, int nargs) {
+    if (nargs != 0) {
+	    xmlXPathSetArityError(ctxt);
+        return;
+    }
+
+    valuePush(ctxt, xmlXPathNewString(ctxt->context->doc->URL));
+}
+
+/**
  * exsltSaxonLineNumberFunction:
  * @ctxt:  an XPath parser context
  * @nargs: number of arguments
@@ -264,4 +283,7 @@
     xsltRegisterExtModuleFunction ((const xmlChar *) "line-number",
 				   SAXON_NAMESPACE,
 				   exsltSaxonLineNumberFunction);
+    xsltRegisterExtModuleFunction ((const xmlChar *) "systemId",
+				   SAXON_NAMESPACE,
+				   exsltSaxonSystemIdFunction);
 }

Attachment: signature.asc
Description: Digital signature

Reply via email to