cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r1457866 - /cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/neko/NekoGenerator.java
Date Mon, 18 Mar 2013 17:08:25 GMT
Author: thorsten
Date: Mon Mar 18 17:08:25 2013
New Revision: 1457866

URL: http://svn.apache.org/r1457866
Log:
Allowing to pass NekoFilter via sitemap.

Modified:
    cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/neko/NekoGenerator.java

Modified: cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/neko/NekoGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/neko/NekoGenerator.java?rev=1457866&r1=1457865&r2=1457866&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/neko/NekoGenerator.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/main/java/org/apache/cocoon/optional/pipeline/components/sax/neko/NekoGenerator.java
Mon Mar 18 17:08:25 2013
@@ -30,6 +30,7 @@ import org.apache.cocoon.sax.AbstractSAX
 import org.apache.cocoon.sax.SAXConsumer;
 import org.apache.cocoon.sax.component.XMLGenerator;
 import org.apache.commons.lang.StringUtils;
+import org.apache.xerces.xni.parser.XMLDocumentFilter;
 import org.cyberneko.html.parsers.SAXParser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,6 +41,8 @@ import org.xml.sax.SAXNotSupportedExcept
 
 public class NekoGenerator extends AbstractSAXGenerator {
 
+    private static final String PROPERTIES_FILTERS = "http://cyberneko.org/html/properties/filters";
+
     public static final String DEFAULT_ENCODING = "http://cyberneko.org/html/properties/default-encoding";
 
     public static final String BALANCE_TAGS_URI = "http://cyberneko.org/html/features/balance-tags";
@@ -120,6 +123,10 @@ public class NekoGenerator extends Abstr
             if(StringUtils.isNotBlank(value)) {
                 this.saxParser.setProperty(DEFAULT_ENCODING, value);
             }
+            XMLDocumentFilter[] filters = (XMLDocumentFilter[]) configuration.get("neko-filter");
+            if(null != filters){
+                this.saxParser.setProperty(PROPERTIES_FILTERS, filters);
+            }
         } catch (Exception e) {
             LOG.error("Fatal could not set default-encoding. ", e);
         }



Mime
View raw message