有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

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

我有两个.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>

还有格恩。从模式生成的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>

我想在XSL中加入这些.xml文件,为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) 个答案