You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2003/12/28 06:22:07 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo FOAttributes.java

pbwest      2003/12/27 21:22:07

  Modified:    src/java/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design
                        FOAttributes.java
  Log:
  Eliminated checks for xmlns* in line with removal of
  namespace-prefixes feature from parser.
  Localised some varialbe references.
  Interned LocalName.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.2   +10 -18    xml-fop/src/java/org/apache/fop/fo/Attic/FOAttributes.java
  
  Index: FOAttributes.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Attic/FOAttributes.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- FOAttributes.java	5 Jul 2003 19:26:05 -0000	1.1.2.1
  +++ FOAttributes.java	28 Dec 2003 05:22:07 -0000	1.1.2.2
  @@ -150,35 +150,26 @@
           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 @@
                   }
                   // 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);
  
  
  

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