Skip to content

Commit

Permalink
Fixed bug in XInclude module
Browse files Browse the repository at this point in the history
  • Loading branch information
nbelaevski committed Aug 3, 2010
1 parent 077e23c commit 4e50a44
Showing 1 changed file with 11 additions and 8 deletions.
Expand Up @@ -18,6 +18,12 @@
*/
package org.apache.cocoon.pipeline.component.sax;

import java.io.IOException;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.cocoon.pipeline.component.xpointer.XPointer;
import org.apache.cocoon.pipeline.component.xpointer.XPointerContext;
import org.apache.cocoon.pipeline.component.xpointer.parser.ParseException;
Expand All @@ -33,12 +39,6 @@
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.XMLReaderFactory;

import java.io.IOException;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

public final class XIncludeTransformer implements SAXConsumer {
private static final String DEFAULT_CHARSET = "UTF-8";
private static final String HTTP_ACCEPT = "Accept";
Expand Down Expand Up @@ -399,8 +399,11 @@ public void startPrefixMapping(String prefix, String uri) throws SAXException {

public void endPrefixMapping(String prefix) throws SAXException {
if (isEvaluatingContent()) {
getContentHandler().endPrefixMapping(prefix);
namespaces.remove(prefix);
String uri = namespaces.remove(prefix);

if (!XINCLUDE_NAMESPACE_URI.equals(uri)) {
getContentHandler().endPrefixMapping(prefix);
}
}
}

Expand Down

0 comments on commit 4e50a44

Please sign in to comment.