如何在1个XSL中加入2个XML

时间:2016-08-15 19:09:42

标签: java xml xslt

我有两个需要加入的.xml个文件

第一个文件是Song.xml,如下所示:

<Songs>
  <Song>
    <SongID>1</SongID>
    <SongName>We dont talk anymore</SongName>
    <Author>M-TP</Author>
    <UploadBy>admin</UploadBy>
    <GerneCode>1</GerneCode>
  </Song>
</Songs>

和从架构生成的Gerne.xml

<ns2:gernes xmlns="http://www.w3.org/2001/XMLSchema/playlist" xmlns:ns2="https://xml.netbeans.org/schema/genses">
    <ns2:gerne>
        <GerneCode>1</GerneCode>
        <GerneName>Pop</GerneName>        
        <Image>img-pop.jpg</Image>
    </ns2:gerne>
</ns2:gerne>

我想在.xml中加入这些XSL个文件,为Gerne.xml内的每个与GerneName匹配的歌曲添加GerneName。

我试图获得的结果应该是这样的:

<Songs>
      <Song>
        <SongID>1</SongID>
        <SongName>We dont talk anymore</SongName>
        <Author>M-TP</Author>
        <UploadBy>admin</UploadBy>
        <GerneName>Pop</GerneName>
        <GerneCode>1</GerneCode>
      </Song>
</Songs>

任何人都可以帮我吗?任何例如或关键字我应该查找这个问题?

0 个答案:

没有答案