No extension attribute now matches all extensions
authorStefanos A <stapostol@gmail.com>
Sun, 3 Nov 2013 20:28:24 +0000 (21:28 +0100)
committerStefanos A <stapostol@gmail.com>
Sun, 3 Nov 2013 20:28:24 +0000 (21:28 +0100)
This allows us to reduce the amount of clutter in overrides.xml.

Source/Bind/FuncProcessor.cs

index c3050ca35740b675b6284bc5ff704e067c9ff917..57c1ae5b4959a716460355648d7e2f686f6344d3 100644 (file)
@@ -106,8 +106,12 @@ namespace Bind
 
             if (extension != null)
             {
+                // match an override that has this specific extension
+                // *or* one that has no extension at all (equivalent
+                // to "match all possible extensions")
                 path.Append(String.Format(
-                    "/function[contains(concat('|', @name, '|'), '|{0}|') and contains(concat('|', @extension, '|'), '|{1}|')]",
+                    "/function[contains(concat('|', @name, '|'), '|{0}|') and " +
+                    "(contains(concat('|', @extension, '|'), '|{1}|') or not(boolean(@extension)))]",
                     function,
                     extension));
             }