Stephen Bash wrote:
> Andy-
>
> Based on the snippet you list here, I don't think you NEED to
> transform the document (you may find it makes your life easier, but it
> may not be required). I think you'll want to look at the following
> HOWTO:
>
> http://castor.org/how-to-use-references-in-xml.html
>
> Let us know if you have more questions.
Hi Stephen,
Thanks very much for this reference (sorry)! It looks almost exactly like what
I need, but I'm not clear if I can extend it to my scenario where the
references are between different classes.
The way that the Pointerror objects are obtained will be through the
point.getErrors() method, so in this case there actually *is* a hierarchy... I
just don't want it displayed as such! The only way I can imagine this working
would be if I can do something like this in the mapping:
<class name="Point" identity="PointId">
<field name="PointId">
<bind-xml name="pointId" node="attribute"/>
</field>
...
<field name="Errors" type="PointError" collection="sortedset">
<bind-xml name="pointerror" node="element" location="../pointerrors"/>
</field>
</class>
...
<class name="PointError">
<field name="Point">
<bind-xml name="pointId" node="attribute" reference="true"/>
</field>
</class>
(i.e. use the class[identity] and bind-xml[reference] attributes as in the
example, but also use "../" in the bind-xml[location] attribute for
point.errors)
Is this possible, or will I have to fall back to less clever mechanisms? I'm
guessing that the location attribute doesn't handle full-on XPath statements,
but I could be wrong :-)
Thanks again,
Andy
--
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email