Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JiBX 1.1.6
-
Fix Version/s: None
-
Component/s: core
-
Labels:None
-
Environment:java version "1.5.0_13"
-
Number of attachments :1
Description
After unmarshalling the enclosed file (dptest.xml) the required attributes are missing from elements Collection (name) and ConditionalProperties (condition, value). See and compare with the marshalled document (dptestout.xml) at lines 7, 96, 126 and 133.
Attached is the whole project, build.xml is in bin/ and used binding is config/psdp.jibx.xml
The output file is generated from test case DPTest.testUnmarshall() (from test folder).
-
Hide
- dp-model.zip
- 27/Aug/08 4:40 AM
- 131 kB
- Pavol Šimo
-
- dp-model/dptestout.xml 380 kB
- dp-model/.project 0.4 kB
- dp-model/config/psdp.xsd 10 kB
- dp-model/config/psdp.jibx.xml~~ 2 kB
- dp-model/config/psdp.jibx.xml 12 kB
- dp-model/config/psdp.dtd 4 kB
- dp-model/bin/build.properties 0.4 kB
- dp-model/bin/build.xml 2 kB
- dp-model/bin/local.build.properties 0.2 kB
- dp-model/.classpath 0.4 kB
- dp-model/test/sk/.../services/dp/DPTest.java 2 kB
- dp-model/logs/amSecurity 0.5 kB
- dp-model/logs/amSMSLdap 0.5 kB
- dp-model/logs/PLLClient 0.5 kB
- dp-model/logs/amJSS 0.6 kB
- dp-model/logs/amUtil 0.5 kB
- dp-model/logs/amSMSEvent 0.5 kB
- dp-model/logs/amSMS 0.5 kB
- dp-model/logs/amSDK 0.5 kB
- dp-model/logs/amProfile_ldap 0.5 kB
- dp-model/logs/amEventService 0.5 kB
- dp-model/logs/amSession 0.5 kB
- dp-model/logs/amProfile 0.5 kB
- dp-model/logs/amNaming 0.5 kB
- dp-model/logs/amComm 0.5 kB
- dp-model/logs/amAuthInternalLDAPModule 0.5 kB
- dp-model/logs/amAuthXMLUtils 0.5 kB
- dp-model/logs/amAuthContext 0.5 kB
- dp-model/logs/amSSOProvider 0.5 kB
- dp-model/logs/amAuthInternalSMModule 0.5 kB
Activity
Dennis Sosnoski
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Dennis Sosnoski [ dsosnoski ] |
The issue seems to be related to element nesting. Attributes are missing from element ConditionalProperties which is nested in another ConditionalProperties element (or Collection in Collection).
But this is not only issue with unmarshalling! Manually setting these attributes to object tree and marshalling it does not show mentioned attributes too.
Try this code:
IBindingFactory bfact = BindingDirectory.getFactory(DisplayProfile.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
DisplayProfile dp = (DisplayProfile) uctx.unmarshalDocument(new FileInputStream("dptest.xml"), null);
ConditionalProperties pr = new ConditionalProperties();
pr.setCondition("client");pr.setValue("XML");
ConditionalProperties pr1 = new ConditionalProperties();
pr1.setCondition("locale");pr1.setValue("sk");
StringProperty sp = new StringProperty();
sp.setName("desktopContainer");sp.setValue("htmlsk");
pr1.addChoice(sp);
pr.addChoice(pr1);
dp.getProperties().addChoice(pr);
dp.marshallTo(new OutputStreamWriter(new FileOutputStream("dptestout.xml")));
and check the resulting file.
This is the relevant part:
<ConditionalProperties condition="client" value="XML">
<ConditionalProperties>
<String name="desktopContainer" value="htmlsk"/>
</ConditionalProperties>
</ConditionalProperties>
should be
<ConditionalProperties condition="client" value="XML">
<ConditionalProperties condition="locale" value="sk">
<String name="desktopContainer" value="htmlsk"/>
</ConditionalProperties>
</ConditionalProperties>