jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r746609 - in /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons: AbstractSession.java xml/Exporter.java
Date Sun, 22 Feb 2009 01:20:24 GMT
Author: jukka
Date: Sun Feb 22 01:20:24 2009
New Revision: 746609

URL: http://svn.apache.org/viewvc?rev=746609&view=rev
Log:
JCR-1952: DOMException: NAMESPACE_ERR thrown when exporting document view

Need to keep emitting explicit xmlns attributes for the ContentHandler exports. The TCK (and
possibly other clients also) depends on that at least on Sun's Java 1.4.

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/Exporter.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java?rev=746609&r1=746608&r2=746609&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
Sun Feb 22 01:20:24 2009
@@ -40,7 +40,6 @@
 import org.apache.jackrabbit.commons.xml.ParsingContentHandler;
 import org.apache.jackrabbit.commons.xml.SystemViewExporter;
 import org.apache.jackrabbit.commons.xml.ToXmlContentHandler;
-import org.apache.jackrabbit.commons.xml.XmlnsContentHandler;
 import org.apache.jackrabbit.util.XMLChar;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
@@ -274,8 +273,7 @@
             boolean skipBinary, boolean noRecurse)
             throws IOException, RepositoryException {
         try {
-            ContentHandler handler =
-                new XmlnsContentHandler(new ToXmlContentHandler(out));
+            ContentHandler handler = new ToXmlContentHandler(out);
             exportDocumentView(absPath, handler, skipBinary, noRecurse);
         } catch (SAXException e) {
             Exception exception = e.getException();
@@ -307,8 +305,7 @@
             boolean skipBinary, boolean noRecurse)
             throws IOException, RepositoryException {
         try {
-            ContentHandler handler =
-                new XmlnsContentHandler(new ToXmlContentHandler(out));
+            ContentHandler handler = new ToXmlContentHandler(out);
             exportSystemView(absPath, handler, skipBinary, noRecurse);
         } catch (SAXException e) {
             Exception exception = e.getException();

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/Exporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/Exporter.java?rev=746609&r1=746608&r2=746609&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/Exporter.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/xml/Exporter.java
Sun Feb 22 01:20:24 2009
@@ -428,6 +428,9 @@
             String namespace = (String) entry.getKey();
             String prefix = (String) entry.getValue();
             handler.startPrefixMapping(prefix, namespace);
+            attributes.addAttribute(
+                    "http://www.w3.org/2000/xmlns/", prefix, "xmlns:" + prefix,
+                    "CDATA", namespace);
         }
 
         // Emit the start element event, and clear things for the next element



Mime
View raw message