Hi Holger, Maybe I'm missing something, but I don't see why using java.lang.Object wouldn't work for this case. ID/IDREF are an untyped linkage mechanism, so there shouldn't be any constraints on using the same form of references to different types of elements.
- Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Holger Schultz wrote: > Hi all, > > i've run into a little problem here. Maybe someone has a solution or an idea > how > it could be solve. > > Within an XML-Document there is an element which references another element. > If > the referenced element is always of the same type I've got no problem by using > ID/IDREF. > > Unfortunatelly in this case there is no way to tell what kind of element will > be > referenced. Example: > > ------------------------------------- > <SERVICES NAME="S1"> > <SERVICE ID="SID1"> > <DATA>Wrzlprmpf</DATA> > </SERVICE> > </SERVICES > > <SERVICES NAME="S2"> > <REF IDREF="SID1"/> > </SERVICES > > <CUSTOMERS NAME="C1"> > <CUSTOMER ID="CID1"/> > <NAME>Holger</NAME> > </CUSTOMER> > </CUSTOMERS> > <CUSTOMERS NAME="C2"> > <REF IDREF="SID1"/> > </CUSTOMERS> > ------------------------------------- > > As you can see element "REF" can reference a "SERVICE" as well as a > "CUSTOMER". > So it is impossible to tell what kind of element will be referenced. As far > as I > figured it out an ID/IDREF solution can't be used here. > > Is there any way to tell "REF" and it's representing class that the referenced > object can be of any kind. I tried java.lang.Object but after a failed attempt > of compiling it, it was quite obvious to me why this couldn't work (shame on > me). > > So, any suggestions or (even better) solutions will be highly appreciated. > > @Dennis: Thank you so much for your great work and effort here. > > regards, > Holger > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users