[Simple-support] Cycle-Support by ID
Brought to you by:
niallg
|
From: Stumpf, J. T. <Tho...@st...> - 2011-06-07 16:16:12
|
Hi! I'm rather new to Simple XML-Serialization library/framework so please forgive me if I ask quite clear, frequently asked or obvious things: We have an existing XML scheme which I want to use in java within an Android app - to be exact I want to use the data exported as instances of this scheme. My problem right now is that we have existing IDs which are XML conform. These constist of a few characters and an unique number. These two parts are combined by a hyphen. So it's something like poi-123. As said before that is a unique and valid XML-ID-type conform value and it hast o be - so we can not change it to numbers (it doesn't make sense to give up valid document values for invalid, does it?). We are referencing these ids by id-references in childs within the object and sisters objects. So these childs are reference objects pointing tot he matching objects in a XML scheme conform way. ... <object id="poi-123"..> <oref idref="poi-124"/> <!-- pointing to subsequent sister object of parent --> ... </object> <object id="poi-124"..> <oref idref="poi-124"/> <!-- pointing to parent object and an subsequent object --> <oref idref="poi-125"/> ... </object> ... I tried to implement this reference by using the CycleStrategy-Pattern but it most probably fails because of the format of the id - the result is that the id attribute is ignored. I wanted to do it that way, because there may exist references to the object itself or one of it's parents. Of course I could implement a method to search all the objects to find one with the proper id but if the CycleStrategy exists it doesn't seem to be wise to reinvent the wheel... Can you give me a hint how to implement it or is the library right now not able to use this type of ids? If the later is true can/will the usage of XML-scheme conform ids be implemented soon? Can I help implementing it? Is there an alternative to do it? Regards Thorsten |