jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Caruana" <david.caru...@alfresco.org>
Subject RE: ExportDocViewTest issues?
Date Thu, 29 Sep 2005 11:18:10 GMT
Marcel,

I've dug further and it was in fact an issue with the version of xalan
used in my environment - see
http://issues.apache.org/jira/browse/XALANJ-2091 for details.

So, backing out to the implementation provided by the Java runtime has
fixed the namespace attribute issue.

However, I'm still having issues with the default/empty namespace, which
I now export.  It's not picked up as an attribute by the Java RT DOM
implementation, therefore the namespace count assertion is still failing
(it's out by 1 as the default namespace is not within the DOM).  As a
side note, the document and system xml examples in the spec do not
contain the default namespace declaration.

Which Transformer implementation are you testing with?

Thanks,
David

New export file...

<?xml version="1.0" encoding="UTF-8"?>
<testdata xmlns:alf="http://www.alfresco.org"
xmlns:d="http://www.alfresco.org/model/dictionary/1.0" 
xmlns:view="http://www.alfresco.org/view/repository/1.0" 
xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 
xmlns:act="http://www.alfresco.org/model/action/1.0" 
xmlns:app="http://www.alfresco.org/model/application/1.0" 
xmlns:usr="http://www.alfresco.org/model/user/1.0" 
xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" 
xmlns:cm="http://www.alfresco.org/model/content/1.0" 
xmlns:sv="http://www.jcp.org/jcr/sv/1.0" 
xmlns:mix="http://www.jcp.org/jcr/mix/1.0" 
xmlns:jcrtest="http://www.alfresco.org/test/jcr/1.0" 
xmlns:jcr="http://www.jcp.org/jcr/1.0" 
xmlns:sys="http://www.alfresco.org/model/system/1.0" 
xmlns:rule="http://www.alfresco.org/model/rule/1.0" 
xmlns="" 
jcr:primaryType="jcrtest:testtype" 
jcr:mixinTypes="mix:referenceable" 
jcr:uuid="0e806548-30cf-11da-b21b-79fcc4285795" 
jcrtest:booleanProp="true" 
jcrtest:doubleProp="3.141592653589793" 
jcrtest:dateProp="2005-09-16T19:20:05.034+01:00" 
jcrtest:longProp="90834953485278298" 
jcrtest:nameProp="jcrtest:test" 
jcrtest:stringProp="2005-09-16T20:20:05.555+01:00" 
</testdata>


-----Original Message-----
From: Marcel Reutegger [mailto:marcel.reutegger@gmx.net] 
Sent: 29 September 2005 10:15
To: jackrabbit-dev@incubator.apache.org
Subject: Re: ExportDocViewTest issues?

David Caruana wrote:
> I'm struggling to pass the ExportDocViewTest even though I believe I 
> have generated a compliant document xml view.
> 
> All is fine until the ExportDocViewTest.compareNamespaces() method is 
> called.  It attempts to extract the namespaces that have been declared

> on the root document node by getting all attributes on the node and 
> seperating those that are xmlns prefixed.
> 
> My problem is that the root node never has the xmlns attributes in the

> dom result - it only contains the "true" attributes.  The 
> TransformerFactory and Transformer implementations are 
> org.apache.xalan in my environment.

That's a bit strange, because the namespace declarations are
definitively there as your example shows. Have you been able to narrow
down whether it's the DOM implementation or the test case that could not
find the namespace declarations?

> Also, the assert at the end subtracts one from the number of 
> registered namespaces - why? For the xml namespace?

That's because the xml namespace is implicitly defined in an xml
document, but the namespace registry in JCR will still contain the
prefix to namespace mapping. The -1 compensates that fact.

I also noticed that a namespace declaration for the empty namespace is
missing in your document view sample. See last paragraph of section 7.2.

regards
  marcel

> Regards,
> Dave
> www.alfresco.org
> 
> Here's an example of a simple noRecurse exported document in case I'm 
> missing something here...
> 
> <?xml version="1.0"?>
> <testdata jcr:primaryType="jcrtest:testtype"
> jcr:mixinTypes="mix:referenceable"
> jcr:uuid="caf234a8-2c1f-11da-a3a2-031c8d888c9d"
> jcrtest:booleanProp="true" jcrtest:doubleProp="3.141592653589793"
> jcrtest:dateProp="2005-09-16T19:20:05.034+01:00"
> jcrtest:longProp="90834953485278298" jcrtest:nameProp="jcrtest:test"
> jcrtest:stringProp="2005-09-16T20:20:05.555+01:00"
> xmlns:app="http://www.alfresco.org/model/application/1.0"
> xmlns:jcrtest="http://www.alfresco.org/test/jcr/1.0"
> xmlns:usr="http://www.alfresco.org/model/user/1.0"
> xmlns:rule="http://www.alfresco.org/model/rule/1.0"
> xmlns:jcr="http://www.jcp.org/jcr/1.0"
> xmlns:ver="http://www.alfresco.org/model/versionstore/1.0"
> xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
> xmlns:act="http://www.alfresco.org/model/action/1.0"
> xmlns:d="http://www.alfresco.org/model/dictionary/1.0"
> xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
> xmlns:cm="http://www.alfresco.org/model/content/1.0"
> xmlns:alf="http://www.alfresco.org"
> xmlns:sv="http://www.jcp.org/jcr/sv/1.0"/>
> 
> 

Mime
View raw message