XSLT を使用して XML を変換しています。webdocument タイプのノードを持つ 1 つの webdocuments ノードを持つ xml があります。
<webDocuments>
<WebDocument>
<id>808924</id>
<fileName><![CDATA[file name]]></fileName>
<filePath><![CDATA[.../201504/808924/filename.pdf]]></filePath>
<hash><![CDATA[1c1bc9f96349fc954cba2dfb58f214b1]]></hash>
<title><![CDATA[Primer document]]></title>
<creationDate class="sql-timestamp">30/05/2012 15:49:57</creationDate>
</WebDocument>
</webDocuments>
そして、ファイルパスノードの値 (ファイルシステム) を URL に変換しようとしています。上に、変換された例があります。ここで、param1 は $hash、ハッシュ ノード値 (この場合は 1c1bc9f96349fc954cba2dfb58f214b1)、param2 は $id、その場合は ID ノード値 808924 です。
<webDocuments>
<WebDocument>
<id>808924</id>
<fileName><![CDATA[file name]]></fileName>
<filePath>http://url.com/param1=$hash¶m2=$id</filePath>
<hash><![CDATA[1c1bc9f96349fc954cba2dfb58f214b1]]></hash>
<title><![CDATA[Primer document]]></title>
<creationDate class="sql-timestamp">30/05/2012 15:49:57</creationDate>
</WebDocument>
</webDocuments>
要約すれば
<filePath>http://url.com/param1=1c1bc9f96349fc954cba2dfb58f214b1¶m2=808924
多くのことを試しましたが、期待した結果が得られません:
<xsl:template match="/webDocuments">
<xsl:for-each select="/WebDocument">
<xsl:value-of select="$hash"/>
<xsl:value-of select="concat($baseUrl,$baseCAPUrl,$hash,'&fileId=')"/>
</xsl:for-each>
</xsl:template>
要約すると、私の結果は、ノード値を取得し、それを使用して別の値を生成することです。
前もって感謝します