xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject svn commit: r660273 - /xalan/c/trunk/src/xalanc/XSLT/ElemElement.cpp
Date Mon, 26 May 2008 19:07:45 GMT
Author: dbertoni
Date: Mon May 26 12:07:42 2008
New Revision: 660273

URL: http://svn.apache.org/viewvc?rev=660273&view=rev
Log:
Fixes for XALANC-615.

Modified:
    xalan/c/trunk/src/xalanc/XSLT/ElemElement.cpp

Modified: xalan/c/trunk/src/xalanc/XSLT/ElemElement.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ElemElement.cpp?rev=660273&r1=660272&r2=660273&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ElemElement.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ElemElement.cpp Mon May 26 12:07:42 2008
@@ -159,8 +159,6 @@
 
         XalanDOMString::size_type   namespaceLen = length(elemNameSpace);
 
-        bool    foundResultNamespaceForPrefix = false;
-
         XalanDOMString::size_type           len = length(elemName);
 
         const XalanDOMString::size_type     indexOfNSSep = indexOf(elemName, XalanUnicode::charColon);
@@ -176,45 +174,35 @@
             substring(elemName, prefix, 0, indexOfNSSep);
 
             const XalanDOMString* const     theNamespace =
-                executionContext.getResultNamespaceForPrefix(prefix);
+                getNamespacesHandler().getNamespace(prefix);
 
-            if (theNamespace != 0)
-            {
-                foundResultNamespaceForPrefix = true;
-            }
-            else
+            if(theNamespace == 0 && namespaceLen == 0)
             {
-                const XalanDOMString* const     theNamespace =
-                    getNamespacesHandler().getNamespace(prefix);
+                warn(
+                    executionContext,
+                    XalanMessages::PrefixIsNotDeclared_1Param,
+                    prefix);
 
-                if(theNamespace == 0 && namespaceLen == 0)
+                if (m_namespaceAVT != 0)
                 {
-                    warn(
-                        executionContext,
-                        XalanMessages::PrefixIsNotDeclared_1Param,
-                        prefix);
-
-                    if (m_namespaceAVT != 0)
-                    {
-                        elemName.erase(0, indexOfNSSep + 1);
-                    }
-                    else
-                    {
-                        isIllegalElement = true;
-
-                        warn(
-                            executionContext,
-                            XalanMessages::IllegalElementName_1Param,
-                            elemName);
-                    }
+                    elemName.erase(0, indexOfNSSep + 1);
                 }
-                else if (theNamespace != 0 &&
-                         namespaceLen == 0 &&
-                         equals(prefix, DOMServices::s_XMLNamespace) == false)
+                else
                 {
-                    elemNameSpace = *theNamespace;
+                    isIllegalElement = true;
+
+                    warn(
+                        executionContext,
+                        XalanMessages::IllegalElementName_1Param,
+                        elemName);
                 }
             }
+            else if (theNamespace != 0 &&
+                namespaceLen == 0 &&
+                equals(prefix, DOMServices::s_XMLNamespace) == false)
+            {
+                elemNameSpace = *theNamespace;
+            }
         }
 
         if (isIllegalElement == false)
@@ -222,7 +210,7 @@
             executionContext.startElement(c_wstr(elemName));   
 
             if(0 == m_namespaceAVT &&
-               (havePrefix == false || foundResultNamespaceForPrefix == true))
+               havePrefix == false )
             {
                 if (havePrefix == false)
                 {



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message