Hello, i'm fairly new to xsl stylesheets but have always wanted to know how to merge two xml documents and transform them to output a xml document referencing certain elements.
I've written up two simple xml documents to help you guys understand what i am after.
And the output that i'd like:
So basically the books.xml 'author' element is a foreign key that references the authors.xml author entries. (i'm assuming using muenchian?)
- For each author, "name", "born", "nationality" and "about_me" along with all their "books".
- The books are grouped by "genre" and then sorted on "published_date".
- For each book, the "title", "description, "price" will be stored also.
 I can show you how to do that, but before doing that, I do not target the output document in exactly the same as what you propose, in particular, I will not put the genre into the attribute to books (as the same author can write different genre of books). Instead I would show the demo with genre put in the book instead.
[0.1] There are quite a few typo and/or consistency in tagging in the sample. I only take the spirit of it and use a consistently named sample (like date vs published_date).
[0.2] Apart from that, the techniques being used to achieve the result are sufficiently varying so that any change of mind can easily be done by yourself with the techniques as demonstrated.
 Here is the xsl document. It is supposed to operate on authors.xml and that the books.xml is in the same directory as authors.xml.
[1.1] I suppose there always exist genre and published_date. In case one or both might be absent, it is easy to add a node test with xsl:if to filter the cases.