artworks.xml文件:XML文件轉換
<artworks>
<artwork>
<title>Adoration of the Magi</title>
<author>GHIRLANDAIO, Domenico</author>
<date>1487</date>
<technique>Tempera on wood, diameter: 171 cm</technique>
<location>Galleria degli Uffizi, Florence</location>
<form>painting</form>
<type>religious</type>
</artwork>
</artworks>
author.xml文件:
<authors>
<author>
<name>AMADEO, Giovanni Antonio</name>
<born-died>b. ca. 1447, Pavia, d. 1522, Milano</born-died>
<nationality>Italian</nationality>
<biography>Giovanni Antonio Amadeo was an Italian early Renaissance sculptor</biography>
</author>
<authors>
的Output.xml文件:
<authors>
<author>
<name>AMADEO, Giovanni Antonio</name>
<born-died>b. ca. 1447, Pavia, d. 1522, Milano</born-died>
<nationality>Italian</nationality>
<biography>Giovanni Antonio Amadeo was an Italian early Renaissance sculptor</biography>
<artworks form="architecture">
<artwork date="1473">
<title>Faهade of the church</title>
<technique>Marble</technique>
<location>Certosa, Pavia</location>
</artwork>
</artworks>
</author>
</authors>
的artworks.xml作者作品是一個外鍵,引用authors.xml作者 條目。
我想合併這兩個XML文檔並創建一個新的XML文件,其中 應爲每個作者存儲以下信息:名稱,出生死亡,國籍, 傳記和所有作品。藝術品按表格分組,然後按日期排序。對於 每個藝術品,標題,技術和位置存儲
是challanging:)
+1非常好的答案:遍歷作者和按作者+表格分組作品。一些未成年人:如果您要覆蓋身份規則,請使用' '而不是' '如果你打算使用push風格,你可以像'select ='一樣完成它$ ART [generate-id()= generate-id(key('byNameForm',concat(current()/name,'|',form))[1])]''或者您可以爲作者使用第二個鍵(這將在外部文檔上添加鍵的示例)。 –
2011-04-25 19:49:52