[ http://issues.apache.org/jira/browse/JCR-620?page=all ]
Stefan Guggisberg updated JCR-620:
----------------------------------
Component/s: xml
(was: JCR API)
Summary: Workspace.getImportHandler() doesn't handle namespace
declarations in document view when they are reported as attributes (was:
Document View Import tests fail for EMF/XMI serialization)
Issue Type: Bug (was: Test)
when importing a document view xml file using Workspace.getImportHandler()
any namespace declarations reported as element attributes (e.g.
xmlns:foo="http://acme.org/foo")
will be misinterpreted as jcr properties. any attempt to access sucha property
using the
jcr api will lead to an UndeclaredPrefixException since the xmlns namespace
cannot be used in jcr.
btw: whether namespace declarations are reported as element attributes is
governed by the
following sax feature: http://xml.org/sax/features/namespace-prefixes
see http://xerces.apache.org/xerces2-j/features.html#namespace-prefixes
i don't know how this can be controlled when doing dom->sax transformations
using javax.xml.transform.Transformer.
> Workspace.getImportHandler() doesn't handle namespace declarations in
> document view when they are reported as attributes
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: JCR-620
> URL: http://issues.apache.org/jira/browse/JCR-620
> Project: Jackrabbit
> Issue Type: Bug
> Components: xml
> Affects Versions: 1.1
> Environment: New JUnit for org.apache.jackrabbit.test.api
> Reporter: Dan Connelly
> Assigned To: Stefan Guggisberg
> Attachments: DocumentViewDOMSourceImportTest.java,
> XMIDocumentViewImportTest.java, XMIDocumentViewImportTest.java,
> XMIDocumentViewImportTest.java
>
>
> XMIDocumentViewImportTest is copy of DocumentViewImportTest EXCEPT that
> createSimpleDocument is overridden.
> New simple document is typical of XMI serializations from Eclipse Modeling
> Framework (EMF).
> Four out of eight tests fail due to bad uri Trace below:
> javax.jcr.NamespaceException:
> www.apache.org/jackrabbit/test/namespaceImportTest7: is not a registered
> namespace uri.
> at
> org.apache.jackrabbit.core.NamespaceRegistryImpl.getPrefix(NamespaceRegistryImpl.java:378)
> at
> org.apache.jackrabbit.core.LocalNamespaceMappings.getPrefix(LocalNamespaceMappings.java:193)
> at
> org.apache.jackrabbit.core.SessionImpl.getNamespacePrefix(SessionImpl.java:1307)
> at
> org.apache.jackrabbit.test.api.XMIDocumentViewImportTest.checkImportSimpleXMLTree(XMIDocumentViewImportTest.java:176)
> at
> org.apache.jackrabbit.test.api.XMIDocumentViewImportTest.performTests(XMIDocumentViewImportTest.java:154)
> at
> org.apache.jackrabbit.test.api.XMIDocumentViewImportTest.doTestImportXML(XMIDocumentViewImportTest.java:119)
> at
> org.apache.jackrabbit.test.api.XMIDocumentViewImportTest.testWorkspaceImportXml(XMIDocumentViewImportTest.java:70)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at
> org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:393)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira