1

我的 xml 中有这些值

<xsl:variable name="template" select="mail/template"/>(作为模板4) <xsl:variable name="portalname" select="mail/portalname"/>(作为测试门户出现)

我需要像最后一样创建这样的东西

<LINK rel="stylesheet" href="/rezsystem/rezsystem_hansa/jboss-4.0.3SP1/server/default/deploy/RezgEmailService.war/xsl/testingportal/css/template4/rezbase_mail.css" type="text/css"/>

和像java一样

String str =  "/rezsystem/rezsystem_hansa/jboss-4.0.3SP1/server/default/deploy/RezgEmailService.war/xsl/"+ portalname+"/css/"+template+"/rezbase_mail.css";

如何在这种情况下进行连接。??

4

2 回答 2

3

您必须使用属性值模板

<LINK rel="stylesheet" href="/rezsystem/rezsystem_hansa/jboss-4.0.3SP1/server/defaultdeploy/RezgEmailService.war/xsl/{$portalname}/css/{$template}/rezbase_mail.css" type="text/css"/>
于 2013-11-06T08:14:30.353 回答
-2

见:http ://www.w3schools.com/xpath/xpath_functions.asp

<xsl:value-of select="concat('/rezsystem/rezsystem_hansa/jboss-4.0.3SP1/server/default/deploy/RezgEmailService.war/xsl/', $portalname, '/css/', $template, '/rezbase_mail.css')" />

或使用string-join

<xsl:value-of select="string-join(('/rezsystem/rezsystem_hansa/jboss-4.0.3SP1/server/default/deploy/RezgEmailService.war/xsl/', $portalname, '/css/', $template '/rezbase_mail.css'))" />
于 2013-11-06T08:15:29.497 回答