我使用XSLT转换为XML节点值和我有一个webdocuments节点的XML型webdocument创建与其他节点的信息
<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。上面,有一个例子转化,其中参数1应该是$散列,散列节点的值(在这种情况下1c1bc9f96349fc954cba2dfb58f214b1)和参数2应该是$ 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>
总之我的结果是采取一个节点值,并用它来产生一个又一个。
在此先感谢
提供完整的代码。什么是'$ baseUrl,$ baseCAPUrl,$ hash'? –