svn commit: r639108 - /lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Wed Mar 19 18:49:44 2008
New Revision: 639108

URL: http://svn.apache.org/viewvc?rev=639108&view=rev
Log:
Make AbstractLinkTransformer work with multiple matched attributes on a single element.

Modified:
    lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java

Modified: lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java?rev=639108&r1=639107&r2=639108&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java (original)
+++ lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.java Wed Mar 19 18:49:44 2008
@@ -222,22 +222,20 @@
             this.indent += "  ";
         }
 
-        AttributesImpl newAttrs = null;
-
         Set configs = getMatchingConfigurations(uri, name, attrs);
+        AttributesImpl newAttrs = null;
 
         if (!configs.isEmpty()) {
-
+            newAttrs = new AttributesImpl(attrs);
             this.ignoreLinkElement = false;
 
             for (Iterator i = configs.iterator(); i.hasNext(); ) {
                 AttributeConfiguration config = (AttributeConfiguration) i.next();
-                String linkUrl = attrs.getValue(config.attribute);
+                String linkUrl = newAttrs.getValue(config.attribute);
                 try {
                     if (getLogger().isDebugEnabled()) {
                         getLogger().debug(this.indent + "link URL: [" + linkUrl + "]");
                     }
-                    newAttrs = new AttributesImpl(attrs);
                     handleLink(linkUrl, config, newAttrs);
                 } catch (final Exception e) {
                     getLogger().error("startElement failed: ", e);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.