Re: [Simple-support] Custom Referencing
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-01-29 12:42:30
|
Hi, There are no real limits other that adhering to the Stategy interface, if there is an attribute that references something then just pick it out and use it. The CycleStrategy is not really much more than an IdentityHashMap, where you come up with the unique key. Niall --- On Sat, 29/1/11, Dušan Maliarik <dus...@gm...> wrote: From: Dušan Maliarik <dus...@gm...> Subject: Re: [Simple-support] Custom Referencing To: sim...@li... Received: Saturday, 29 January, 2011, 4:00 AM It seems that even with heavy copy pasting from org.simpleframework.xml.strategy the job can't be done because attribute can represent only primitive type. Is there a reason why attribute cannot represent Composite to allow referencing through attributes? 2011/1/27 Dušan Maliarik <dus...@gm...> That of course was the first thing I tried, but the problem is deeper. I'd need custom ReadGraph (package private), and it's still not clear where to put anyURI's # prefix. I don't see where the actual lookup is done. And even then, I'd endup with instance_geometry referring to geometry, and I'd loose child elements of instance_geometry. Actually only instance_geometry's url attribute should refer to geometry object, and the rest of it's children would still be accessible. I've done this before with JAXB, and python and ruby XML binding libs. But I have no idea how to implement this with simple (seems to be the only android compatible one). Apparently it's not that straight forward. On Thu, Jan 27, 2011 at 12:23, Niall Gallagher <gal...@ya...> wrote: Not sure exactly what the problem is here. But if the CycleStrategy does not work then just write your own strategy, e.g DusansNewCycleStategy, the implementation of the CycleStrategy can just be cut and pasted with modifications. --- On Thu, 27/1/11, Dušan Maliarik <dus...@gm...> wrote: From: Dušan Maliarik <dus...@gm...> Subject: [Simple-support] Custom Referencing To: sim...@li... Received: Thursday, 27 January, 2011, 3:07 AM Hi all, I chose simple for my android application for parsing COLLADA assets. They use object definition / reference schema, so I attempted to use CycleStrategy to ease the pain of traversing the object graph. I failed because in COLLADA schema, anyURI is used for referencing, which implies using hash (#) character in front of IDs. <geometry id="foo">...</geometry> and then <instance_geometry url="#foo">...</instance> I need to both resolve this reference, and have access to the child elements of instance_geometry. I haven't found a suitable place in simple to extend/override. What would be the most convenient solution to this problem in simple XML? -- +Best regards, Dušan Maliarik // cell: +31646233420+ -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support -- +Best regards, Dušan Maliarik // cell: +31646233420+ -- +Best regards, Dušan Maliarik // cell: +31646233420+ -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |