Hi Christofer,
I think that you would need nested collections, which isn’t possible at the moment (at least, as far as I know).
It is possible to update an existing “book” document to insert the “chapter” document, but I think this is slightly different to your intended modelling. (I guess that you want the “chapter” to be a separate doctype.)
Although inserting chapters into the book documents appears to “bury” them, it is still possible to retrieve chapters as distinct objects, with an XPath query like:
/book[@title=‘Huckleberry Finn’]/chapters
(Assuming that the book doctype has a sub-element called “chapters”, this would return the chapters for Huck Finn.)
You could also make the relationship some other way, such as: store “book” documents in the collection, then add XLink references from book to the “chapter” documents.
Hope that helps some.
Trevor.
#API-Management#Tamino#webMethods