Re: [Simple-support] Same Attribute name and different namespace
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-09-22 10:36:07
|
You will have to write a Converter for this. There are some examples in the test cases and the tutorial. --- On Thu, 22/9/11, A K <ak....@gm...> wrote: From: A K <ak....@gm...> Subject: [Simple-support] Same Attribute name and different namespace To: sim...@li... Received: Thursday, 22 September, 2011, 12:03 AM Hi, I have the below input xml file. Am trying to read the data by providing the annotations. <p:input saveSubsetFonts="1"> <p:sldMasterIdLst> <p:masterId id="2147483660" r:id="rId1" /> </p:sldMasterIdLst> <p:sldIdLst> <p:Id id="256" r:id="rId2" /> <p:Id id="257" r:id="rId3" /> <p:Id id="258" r:id="rId4" /> <p:Id id="259" r:id="rId5" /> <p:Id id="275" r:id="rId6" /> </p:sldIdLst> </p:input> The schema definations says as below <xs:attribute type="xs:int" use="optional" name="id"/> * <xs:attribute use="required" ref="ns1:id"/> * </xs:complexType> * * <xs:attribute xmlns:ns="http://namespace1/main" xmlns:ns1="http://namespace2/relationships" xmlns:xs="http://namespace3" type="xs:string" name="id"/> Both the id's attribute has the same name "id". I tried giving the annotations as @Attribute(required=false) @Namespace(reference="http://www.w3.org/2001/XMLSchema") private Integer id; @Attribute(name="id") @Namespace(prefix="r",reference="http://schemas.openxmlformats.org/officeDocument/2006/relationships") private String id1; But, getting the exception : Exception : org.simpleframework.xml.core.PersistenceException: Duplicate annotation of name 'id' on field 'id1' private java.lang.String org..main.MasterIdListEntry.id1 If anyone know how to give exactly, please let me know. Thanks in advance -----Inline Attachment Follows----- ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |