开发者

combine two xml files into one

开发者 https://www.devze.com 2022-12-17 08:43 出处:网络
<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"> <xsl:param name=\"pXml1\" select=\"\'\'\" />
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="pXml1" select="''" />
  <xsl:param name="pXml2" select="''" />
  <xsl:param name="pRoot" sele开发者_如何学Goct="'root'" />

  <xsl:template match="/">
    <xsl:variable name="vXml1" select="document($pXml1)" />
    <xsl:variable name="vXml2" select="document($pXml2)" />

    <xsl:element name="{$pRoot}">
      <xsl:copy-of select="$vXml1/*/*" />
      <xsl:copy-of select="$vXml2/*/*" />
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>

The code fails when $pXml1 contains space Ex. "a b c.xml"

How to solve it ??

Need some encode or not ?


When being passed a string, the document function expects a URI. If your XSLT processor supports it, you can use the str:encode-uri extension function from EXSLT to URI-encode your filename.

0

精彩评论

暂无评论...
验证码 换一张
取 消