cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: rev 36846 - cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation
Date Wed, 25 Aug 2004 09:04:22 GMT
Author: pier
Date: Wed Aug 25 02:04:21 2004
New Revision: 36846

Modified:
   cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Log:
Make sure that we always have a "MultiSourceValidity" while transforming.
Make sure that the "MultiSourceValidity" instance is "closed" after processing (otherwise
it will not perform its checks).

Modified: cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
==============================================================================
--- cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
(original)
+++ cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Wed Aug 25 02:04:21 2004
@@ -81,6 +81,20 @@
         m_validity = null;
     }
 
+    public void startDocument()
+    throws SAXException {
+        // Make sure that we have a validity while processing
+        this.getValidity();
+        super.startDocument();
+    }
+
+    public void endDocument()
+    throws SAXException {
+        // Make sure that the validity is "closed" at the end
+        this.m_validity.close();
+        super.endDocument();
+    }
+
     public void startElement(String uri, String localName, String qName, Attributes atts)

     throws SAXException {
         if (NS_URI.equals(uri)) {
@@ -89,9 +103,7 @@
                 Source source = null;
                 try {
                     source = m_resolver.resolveURI(src);
-                    if (m_validity != null) {
-                        m_validity.addSource(source);
-                    }
+                    m_validity.addSource(source);
                     SourceUtil.toSAX(m_manager, source, "text/xml", 
                             new IncludeXMLConsumer(super.contentHandler));
                 }

Mime
View raw message