Hi all,
I am slowly getting used to JiBX. I can see how useful it is for someone
proficient with the tool.
The issue I am facing is exceptional and concerns how to deal with a List of
elements WITHOUT a wrapping element! I cannot remember the technical term
for this.
DTD:
<!ELEMENT AWARD_OF_CONTRACT ((CONTRACT_NUMBER?, ((EL1, EL2)* )),
CONTRACT_AWARD_DATE? )>
Disclaimer: I did not write the DTD.
Objective: create this XML, ignoring the comments (WITHOUT a wrapper element
around EL1...EL2):
<AWARD_OF_CONTRACT>
<CONTRACT_NUMBER/>
<EL1>1</EL1> <!--block1-->
<EL2>a</EL2> <!--block1-->
<EL1>2</EL1> <!--block2-->
<EL2>b</EL2> <!--block2-->
<CONTRACT_AWARD_DATE/>
(...)
</AWARD_OF_CONTRACT>
Java Objects:
public class AwardOfContract {
private String contractNumber;
private List<Block> block = new ArrayList<Block>();
private Date contractAwardDate;;
}
public class Block {
private Integer el1;
private String el2;
}
The JiBX documentation does specify how to create a list WITH a wrapper
element. E.g:
<BLOCK>
<EL1>1</EL1> block1
<EL2>a</EL2> block1
<EL1>2</EL1> block2
<EL2>b</EL2> block2
</BLOCK>
I cannot find documentation of how to deal with the issue above, that is, a
list WITHOUT a wrapper element. Can JiBX deal with this?
Many thanks for your help.
Regards,
Jon L
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users