Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.9.6RC3
-
Fix Version/s: None
-
Component/s: XML
-
Labels:None
-
Environment:Operating System: All
Platform: All
-
Bugzilla Id:1866
-
Number of attachments :
Description
When unmarshalling an xml document, that contains a sequence of any, the
unmarshaller only retrieves elements until the first element of a sequence, that
has no children, is processed. All other child elements are ignored.
In my case, the following XSD produces unsatisfactory results (excerpt from the
W3C XMLDSig standard):
<complexType name="ObjectType" mixed="true">
<sequence minOccurs="0" maxOccurs="unbounded">
<any namespace="##any" processContents="lax"/>
</sequence>
<attribute name="Id" type="ID" use="optional"/>
<attribute name="MimeType" type="string" use="optional"/> <!-- add a grep
facet -->
<attribute name="Encoding" type="anyURI" use="optional"/>
</complexType>
Marshalling works fine, when adding further castor objects, i.e.:
ObjectTypeItem it = new ObjectTypeItem();
it.setAnyObject(xmlQualifyingProperties);
xmlObject.addObjectTypeItem(it);
produces the correct output xml, when marshalling:
<Object Id="myObject">
<ns1:QualifyingProperties
Target="anotherObject"
xsi:type="ns1:QualifyingProperties"
xmlns:ns1="http://uri.etsi.org/01903/v1.1.1#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns1:SignedProperties>
<ns1:SignedSignatureProperties>
<ns1:SigningCertificate>
<ns1:Cert>
<ns1:CertDigest>
<ns1:DigestMethod Algorithm="MD5withRSA"/>
<ns1:DigestValue>...</ns1:DigestValue>
</ns1:CertDigest>
<ns1:IssuerSerial>
<X509IssuerName>...</X509IssuerName>
<X509SerialNumber>...</X509SerialNumber>
</ns1:IssuerSerial>
</ns1:Cert>
</ns1:SigningCertificate>
<ns1:SigningTime>2005-01-23T18:20:34.459+01:00</ns1:SigningTime>
<ns1:SignaturePolicyIdentifier>
<ns1:SignaturePolicyImplied
xsi:type="java:java.lang.String">text.txt</ns1:SignaturePolicyImplied>
</ns1:SignaturePolicyIdentifier>
</ns1:SignedSignatureProperties>
<ns1:SignedDataObjectProperties/>
</ns1:SignedProperties>
<ns1:UnsignedProperties>
<ns1:UnsignedSignatureProperties/>
<ns1:UnsignedDataObjectProperties/>
</ns1:UnsignedProperties>
</ns1:QualifyingProperties>
</Object>
But when unmarshalling, the returned AnyNode only contains:
[<Object Id="myObject">]
<QualifyingProperties
Target="Diplomarbeit_Secure E-Document-Container_1106236742720.docSignature"
type="ns1:QualifyingProperties"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="http://uri.etsi.org/01903/v1.1.1#"
xmlns="http://www.w3.org/2000/09/xmldsig#">
<ns1:SignedProperties>
<ns1:SignedSignatureProperties>
<ns1:SigningCertificate>
<ns1:Cert>
<ns1:CertDigest>
<ns1:DigestMethod Algorithm="MD5withRSA"/>
</ns1:CertDigest>
</ns1:Cert>
</ns1:SigningCertificate>
</ns1:SignedSignatureProperties>
</ns1:SignedProperties>
</QualifyingProperties>
[</Object>]
I desperately need this to work for my diploma thesis, so please HELP!!!
Thanks in advance, and keep up the good work!
Activity
| Field | Original Value | New Value |
|---|---|---|
| issue.field.bugzillaimportkey | 1866 | 23310 |
| Assignee | Keith Visco [ kvisco ] | Andrew Fawcett [ andrew.fawcett@coda.com ] |
| Status | Open [ 1 ] | In Progress [ 3 ] |
-
- Time Spent:
- 5 hours
-
I spent some time reproducing this problem. In the end I found a couple more issues, but not I think the one your finding. In that generally I did get back out the Marshaller what I had previously Unmarshalled. What I did notice is some issues with the namespaces. See
CASTOR-1105for more information.
| Time Spent | 5 hours [ 18000 ] | |
| Remaining Estimate | 0 minutes [ 0 ] |
| Status | In Progress [ 3 ] | Open [ 1 ] |
| Assignee | Andrew Fawcett [ andrew.fawcett@coda.com ] |
| Priority | Blocker [ 1 ] | Major [ 3 ] |
| Bugzilla Id | 1866 | |
| Assignee | Edward Kuns [ edward.kuns@rockwellfirstpoint.com ] |
| Assignee | Edward Kuns [ edward.kuns@rockwellfirstpoint.com ] |
I believe that this bug is fixed. I'll check.