두 xml 파일을 xslt를 사용하여 하나로 병합하고 싶습니다.xslt를 사용하여 두 xml 파일을 병합
file1:
<cut> <content1> .... </content1> </cut>
file1:
<cut> <content2> .... </content2> </cut>
merged:
<cut>
<content1> ... </content1>
<content2> ... </content2>
</cut>
병합 할 파일이 들어있는 xslt에 매개 변수를 전달하고 싶습니다.
xsltproc.exe "--stringparam 파일 1의 : \ file1.xml --stringparam 파일 2의 : \ file2.xml S : \ merge.xslt
merge.xslt:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">
<xsl:output indent="yes" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:param name="file1"/>
<xsl:param name="file2"/>
<xsl:variable name="big-doc-rtf">
<xsl:copy-of select="document($file1)"/>
<xsl:copy-of select="document($file2)"/>
</xsl:variable>
<xsl:variable name="big-doc" select="exsl:node-set($big-doc-rtf)"/>
<xsl:template match="/">
<cut>
<xsl:apply-templates select="$big-doc/cut/*"/>
</cut>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|text()|comment()|processing-instruction()">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
난 단지 빈 얻을
"컷 ". 태그는 무엇이 잘못