cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jav...@apache.org
Subject svn commit: r1503816 - in /cocoon/cocoon3/trunk/cocoon-optional/src/test: java/org/apache/cocoon/optional/pipeline/components/sax/tika/ resources/org/apache/cocoon/optional/pipeline/components/sax/tika/
Date Tue, 16 Jul 2013 18:12:06 GMT
Author: javier
Date: Tue Jul 16 18:12:05 2013
New Revision: 1503816

URL: http://svn.apache.org/r1503816
Log:
COCOON3-128: remove localized value.

Added:
    cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/remove-date.xsl
Modified:
    cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/tika/TikaGeneratorTestCase.java
    cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-odt.xml
    cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-pdf.xml

Modified: cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/tika/TikaGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/tika/TikaGeneratorTestCase.java?rev=1503816&r1=1503815&r2=1503816&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/tika/TikaGeneratorTestCase.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/test/java/org/apache/cocoon/optional/pipeline/components/sax/tika/TikaGeneratorTestCase.java
Tue Jul 16 18:12:05 2013
@@ -18,6 +18,7 @@ import org.apache.cocoon.pipeline.NonCac
 import org.apache.cocoon.pipeline.Pipeline;
 import org.apache.cocoon.sax.SAXPipelineComponent;
 import org.apache.cocoon.sax.component.XMLSerializer;
+import org.apache.cocoon.sax.component.XSLTTransformer;
 import org.custommonkey.xmlunit.DetailedDiff;
 import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier;
@@ -63,7 +64,10 @@ public class TikaGeneratorTestCase {
         Map<String, Object> config = new HashMap<String, Object>();
         config.put("source", source);
         generator.setConfiguration(config);
+        URL xsltSource = this.getClass().getResource("remove-date.xsl");
+
         pipeline.addComponent(generator);
+        pipeline.addComponent(new XSLTTransformer(xsltSource));
         pipeline.addComponent(new XMLSerializer());
 
         File testFile = this.folder.newFile();

Added: cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/remove-date.xsl
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/remove-date.xsl?rev=1503816&view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/remove-date.xsl
(added)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/remove-date.xsl
Tue Jul 16 18:12:05 2013
@@ -0,0 +1,26 @@
+<!--
+    Document   : remove-date.xsl
+    Created on : 2013/07/16, 18:51
+    Author     : jpuerto
+    Description:
+        Copy and filter localized values from Apache Tika generated metadata.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xhtml="http://www.w3.org/1999/xhtml"
+                version="1.0">
+  <xsl:output method="xml"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- Remove localized value -->
+  <xsl:template match="xhtml:meta[@name = 'created']"/>
+
+  <xsl:template match="text()|*|@*" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|comment()|processing-instruction()|text()|*"/>
+    </xsl:copy>
+  </xsl:template>
+</xsl:stylesheet>

Modified: cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-odt.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-odt.xml?rev=1503816&r1=1503815&r2=1503816&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-odt.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-odt.xml
Tue Jul 16 18:12:05 2013
@@ -45,5 +45,4 @@
 <meta name="nbCharacter" content="11"/>
 <title/>
 </head>
-<body><p>Hello world</p>
-</body></html>
\ No newline at end of file
+<body><p>Hello world</p></body></html>
\ No newline at end of file

Modified: cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-pdf.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-pdf.xml?rev=1503816&r1=1503815&r2=1503816&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-pdf.xml
(original)
+++ cocoon/cocoon3/trunk/cocoon-optional/src/test/resources/org/apache/cocoon/optional/pipeline/components/sax/tika/test-pdf.xml
Tue Jul 16 18:12:05 2013
@@ -10,7 +10,7 @@
 <meta name="xmpTPg:NPages" content="1"/>
 <meta name="Creation-Date" content="2013-07-03T20:34:05Z"/>
 <meta name="meta:author" content="Apache FOP"/>
-<meta name="created" content="Wed Jul 03 22:34:05 CEST 2013"/>
+
 <meta name="cp:subject" content="Apache Cocoon 3.0 sample document."/>
 <meta name="producer" content="Apache FOP Version 1.1"/>
 <meta name="Content-Type" content="application/pdf"/>



Mime
View raw message