Bug 3421: Issue an error if namespace
attribute is used with an empty string in xsl:element


git-svn-id: https://svn.apache.org/repos/asf/xalan/java/trunk@335484 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/org/apache/xalan/templates/ElemElement.java b/src/org/apache/xalan/templates/ElemElement.java
index 30a76d9..ba58f56 100644
--- a/src/org/apache/xalan/templates/ElemElement.java
+++ b/src/org/apache/xalan/templates/ElemElement.java
@@ -305,9 +305,12 @@
       if (null != m_namespace_avt)
       {
         nodeNamespace = m_namespace_avt.evaluate(xctxt, sourceNode, this);
-        if (null == nodeNamespace)
-          nodeNamespace = "";
-
+        if (null == nodeNamespace || 
+            (prefix != null && prefix.length()>0 && nodeNamespace.length()== 0) )
+          transformer.getMsgMgr().error(
+              this, XSLTErrorResources.ER_NULL_URI_NAMESPACE);
+        else
+        {
         // Determine the actual prefix that we will use for this nodeNamespace
 
         prefix = resolvePrefix(rhandler, prefix, nodeNamespace);
@@ -318,6 +321,7 @@
           nodeName = (prefix + ":" + QName.getLocalPart(nodeName));
         else
           nodeName = QName.getLocalPart(nodeName);
+        }
       }
 
       // No namespace attribute was supplied. Use the namespace declarations