You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by pi...@apache.org on 2004/08/25 11:04:22 UTC
svn commit: rev 36846 - cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation
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));
}