Permalink
Browse files

Add nsprefix function for getting the "default" prefix for a given na…

…mespace uri.
  • Loading branch information...
1 parent 37e5603 commit 97864fbd21b50b356b2c46290e93b8a916747006 @danmactough committed Aug 30, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 utils.js
View
@@ -107,4 +107,15 @@ exports.resolve = resolve;
function nslookup (uri, def) {
return NS[uri] === def;
}
-exports.nslookup = nslookup;
+exports.nslookup = nslookup;
+
+/*
+ * Return the "default" namespace prefix for a given namespace URI
+ *
+ * @param {String} URI
+ * @return {String}
+ */
+function nsprefix (uri) {
+ return NS[uri];
+}
+exports.nsprefix = nsprefix;

0 comments on commit 97864fb

Please sign in to comment.