diff --git a/src/transform/apply-gen.xsl b/src/transform/apply-gen.xsl
index 0a8c5c1..77942ce 100644
--- a/src/transform/apply-gen.xsl
+++ b/src/transform/apply-gen.xsl
@@ -120,15 +120,10 @@
select="namespace-uri-for-prefix(
$ns-prefix, . )" />
-
-
-
+ $name-resolv, $local-name, $ns-prefix, $ns )" />
+ $name-resolv, ., $ns-prefix, $ns )" />
@@ -154,9 +149,13 @@
+
+
+
@@ -174,12 +173,17 @@
+
+
+
+
diff --git a/test/transform/apply-gen-test-in.xsl b/test/transform/apply-gen-test-in.xsl
index 7bde386..72a64af 100644
--- a/test/transform/apply-gen-test-in.xsl
+++ b/test/transform/apply-gen-test-in.xsl
@@ -32,5 +32,13 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/test/transform/apply-gen-test.xsl b/test/transform/apply-gen-test.xsl
index 3241470..ecf6c15 100644
--- a/test/transform/apply-gen-test.xsl
+++ b/test/transform/apply-gen-test.xsl
@@ -41,12 +41,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/transform/apply-gen.xspec b/test/transform/apply-gen.xspec
index 888dabe..5409e87 100644
--- a/test/transform/apply-gen.xspec
+++ b/test/transform/apply-gen.xspec
@@ -165,5 +165,17 @@
+
+
+
+
+
+
+
+
+
+
+