[Simple-support] Same Attribute name and different namespace
Brought to you by:
niallg
|
From: A K <ak....@gm...> - 2011-09-22 07:03:31
|
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
|