]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Eliminated checks for xmlns* in line with removal of
authorPeter Bernard West <pbwest@apache.org>
Sun, 28 Dec 2003 05:22:07 +0000 (05:22 +0000)
committerPeter Bernard West <pbwest@apache.org>
Sun, 28 Dec 2003 05:22:07 +0000 (05:22 +0000)
namespace-prefixes feature from parser.
Localised some varialbe references.
Interned LocalName.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197064 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/FOAttributes.java

index 52e91cd5f28eeba8287a0f1ff367b3e6fc0dceb0..7703b25701e215bdc8808dd4d3d597cb0465d7ad 100644 (file)
@@ -150,35 +150,26 @@ public class FOAttributes {
         Attributes attributes = event.getAttributes();
         if (attributes == null) throw new FOPException
                                        ("No Attributes in XMLEvent");
-        int propIndex;
-        HashMap tmpHash;
         for (int i = 0; i < attributes.getLength(); i++) {
-            String attrUri = attributes.getURI(i);
-            String attrLocalname = attributes.getLocalName(i);
-            String attrQName = attributes.getQName(i);
-            int sep = attrQName.indexOf(':');
-            String prefix = attrQName.substring(0, (sep == -1 ? 0 : sep));
-            if (prefix.equals("xmlns")) break;
+            String attrUri = attributes.getURI(i).intern();
+            String attrLocalname = attributes.getLocalName(i).intern();
             String attrValue = attributes.getValue(i);
             int attrUriIndex = foNode.namespaces.getURIIndex(attrUri);
 
             //System.out.println("FONode:" + event);
             if (attrUriIndex == XMLNamespaces.DefAttrNSIndex) {
-                // Standard FO namespace
-                // Catch default namespace declaration here.
-                if (attrLocalname.equals("xmlns")) break;
+                // Standard attribute namespace
                 // Is this a known (valid) property?
-                propIndex = PropNames.getPropertyIndex(attrLocalname);
+                int propIndex = PropNames.getPropertyIndex(attrLocalname);
                     // Known attribute name
                 foAttrMap.put(Ints.consts.get(propIndex), attrValue);
             } else { // Not the XSL FO namespace
-                int j;
                 if (nSpaceAttrMaps == null) {
                     //Create the list
                     System.out.println("Creating nSpaceAttrMaps");
                     nSpaceAttrMaps = new ArrayList(attrUriIndex + 1);
                     // Add the fo list
-                    for (j = 0; j < XMLNamespaces.DefAttrNSIndex; j++)
+                    for (int j = 0; j < XMLNamespaces.DefAttrNSIndex; j++)
                         nSpaceAttrMaps.add(new HashMap(0));
 
                     System.out.println("Adding foAttrMap");
@@ -186,10 +177,11 @@ public class FOAttributes {
                 }
                 // Make sure there are elements between the last current
                 // and the one to be added
-                for (j = nSpaceAttrMaps.size(); j <= attrUriIndex; j++)
+                for (int j = nSpaceAttrMaps.size(); j <= attrUriIndex; j++)
                     nSpaceAttrMaps.add(new HashMap(0));
                 
                 // Does a HashMap exist for this namespace?
+                HashMap tmpHash;
                 if ((tmpHash =
                      (HashMap)nSpaceAttrMaps.get(attrUriIndex)) == null) {
                     tmpHash = new HashMap(1);