jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1952) DOMException: NAMESPACE_ERR thrown when exporting document view
Date Sun, 22 Feb 2009 17:15:04 GMT

    [ https://issues.apache.org/jira/browse/JCR-1952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675676#action_12675676

Jukka Zitting commented on JCR-1952:

To summarize the effect of the selected fix:

* The SAX event stream sent to a given ContentHandler instance remains the same as before.
Most notably the events will consist of both startPrefixMapping calls for all namespaces *and*
explicit xmlns attributes for those same namespaces. This behaviour is expected by the current
TCK and is similar to what you'd get from a SAXParser with the http://xml.org/sax/features/namespace-prefixes
feature enabled.

* The above means that code that uses a ContentHandler instead of an OutputStream to capture
the XML export will need to be aware of this.

* On the other hand, the OutputStream exports are now guaranteed *not* to produce duplicate
xmlns attributes regardless of what JAXP libraries are in the classpath.

> DOMException: NAMESPACE_ERR thrown when exporting document view
> ---------------------------------------------------------------
>                 Key: JCR-1952
>                 URL: https://issues.apache.org/jira/browse/JCR-1952
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-commons, xml
>    Affects Versions: 1.5.2
>            Reporter: Lóránt Pintér
>            Assignee: Jukka Zitting
>             Fix For: 1.5.3
>         Attachments: MANIFEST.MF
> When I try to export some nodes with ExportDocumentView I get a DOMException with Jackrabbit
1.5.2. Version 1.4.6 works fine. Xerces version was 2.8.1.
> Code:
> Document document = documentBuilder.newDocument();
> Element exportElement = (Element) document.appendChild(document.createElement("Export"));
> Result result = new DOMResult(exportElement);
> TransformerHandler transformerHandler = saxTransformerFactory.newTransformerHandler();
> transformerHandler.setResult(result);
> session.exportDocumentView(workflowNode.getPath(), transformerHandler, true, false);
> Exception:
> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object
in a way which is incorrect with regard to namespaces.
> 	at org.apache.xerces.dom.CoreDocumentImpl.checkDOMNSErr(Unknown Source)
> 	at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
> 	at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source)
> 	at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
> 	at org.apache.xerces.dom.ElementImpl.setAttributeNS(Unknown Source)
> 	at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(SAX2DOM.java:194)
> 	at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStartTag(ToXMLSAXHandler.java:204)
> 	at com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending(ToSAXHandler.java:277)
> 	at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startElement(ToXMLSAXHandler.java:646)
> 	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.startElement(TransformerHandlerImpl.java:263)
> 	at org.apache.jackrabbit.commons.xml.Exporter.startElement(Exporter.java:438)
> 	at org.apache.jackrabbit.commons.xml.DocumentViewExporter.exportNode(DocumentViewExporter.java:76)
> 	at org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:298)
> 	at org.apache.jackrabbit.commons.xml.Exporter.exportNodes(Exporter.java:214)
> 	at org.apache.jackrabbit.commons.xml.DocumentViewExporter.exportNode(DocumentViewExporter.java:77)
> 	at org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:295)
> 	at org.apache.jackrabbit.commons.xml.Exporter.export(Exporter.java:144)
> 	at org.apache.jackrabbit.commons.AbstractSession.export(AbstractSession.java:461)
> 	at org.apache.jackrabbit.commons.AbstractSession.exportDocumentView(AbstractSession.java:241)

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message