Hi,
I'm new to JiBX. I'm unable to find the correct usage of "ordered" &
"flexible" tags.
When i specify the "ordered" attribute on the mapping level, I get an error
during JiBX compilation: "*** Error during code generation - please report
this error on the JiBX users list so that the condition can be caught during
validation ***"
When i specify this attribute on the "collection" or "value" level, then the
binding does get compiled, but it is actually not followed. As in.. I get an
exception when i try to parse an unordered xml.
The tutorial on the JiBX site shows the usage on the mapping level (
http://jibx.sourceforge.net/tutorial/binding-extras.html), but the summary (
http://jibx.sourceforge.net/details/xml-summary.html) tells that "ordered"
is defined only for "value", "structure", and "collection".
The parsing works fine for an ordered XML.
Same is the case with the "flexible" attribute.
Am i doing something the wrong way?
My binding file is:
<binding value-style="attribute" >
<mapping class="com.wellmanage.core.common.metrics.agent.data.Record"
name="record" ordered="false">
<value style="element" name="domain" field="domain" usage="required" />
<value style="element" name="machine_nm" field="hostName"
usage="required" />
<value style="element" name="appl_nm" field="applName" usage="required"
/>
<value style="element" name="appl_ver" field="applVersion"
usage="optional" />
<value style="element" name="os_login" field="hostUser" usage="optional"
/>
<value style="element" name="appl_pid" field="applPid" usage="optional"
/>
<collection field="measurement" usage="optional"
factory="org.jibx.runtime.Utility.arrayListFactory" />
</mapping>
<mapping class="com.wellmanage.core.common.metrics.agent.data.Measurement"
name="measurement" >
<collection field="metrics" usage="optional"
factory="org.jibx.runtime.Utility.arrayListFactory" />
<value style="element" name="id" field="measurementId" usage="required"
/>
<value style="element" name="parent_id" field="parentId"
usage="optional" />
<value style="element" name="comp_nm" field="compName" usage="optional"
/>
<value style="element" name="appl_user" field="applUser"
usage="required" />
<value style="element" name="name" field="funcName" usage="required" />
<value style="element" name="step" field="funcStep" usage="required"
deserializer="com.wellmanage.core.common.metrics.agent.data.MetricsStep.getMetricsStep"
/>
<value name="time" field="funcTime" usage="required" />
<value name="duration" field="duration" usage="optional" />
<value name="work_units" field="unitsOfWork" usage="optional" />
</mapping>
<mapping class="com.wellmanage.core.common.metrics.agent.data.Metrics"
name="metrics" >
<value style="element" name="value" field="value" usage="optional" />
<value style="element" name="name" field="name" usage="required" />
</mapping>
</binding>
with regards,
Navnet Kachroo.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users