2016-06-24 13 views
0

私の入力XMLは次のとおりです。なぜ私は値を取得していないです

<urp> 

    <pRespId>2345</pRespId> 
    <pRespApplId>800</pRespApplId> 
    <pSecurityGroupID>0</pSecurityGroupID> 

</urp> 

私はXSL以下使用して、いくつかの変数値移入しようとしています:

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 

    <xsl:template match="/"> 
     <xsl:variable name="pRespId" select="urp/pRespId" /> 
     <xsl:variable name="pRespApplId" select="urp/pRespApplId" /> 
     <xsl:variable name="pSecurityGroupID" select="urp/pSecurityGroupID" /> 
     <xsl:variable name="newURI" select = "'pRespId=$pRespId&amp;pRespApplId=$pRespApplId&amp;pSecurityGroupID=$pSecurityGroupID'"/> 
    </xsl:template> 

</xsl:stylesheet> 

を何とか、私が取得することはできませんよof the pRespId、pRespApplId &、newURIのpSecurityGroupID。私は、この行で何かが欠けています知っている

pRespId=2345&pRespApplId=800&pSecurityGroupID=0 

<xsl:variable name="newURI" select = "'pRespId=$pRespId&amp;pRespApplId=$pRespApplId&amp;pSecurityGroupID=$pSecurityGroupID'" 

誰かが私がここで行方不明です何を整流することができるそれは常に私に

pRespId=$pRespId&pRespApplId=$pRespApplId&pSecurityGroupID=$pSecurityGroupID 

代わりのを見せていますか?

答えて

1

変数newURIは文字列値を設定しています。文字列内の変数参照は評価されません。

あなたはconcat機能を使用してみてください、あなたは

<xsl:variable 
    name="newURI" 
    select="concat('pRespId=', $pRespId, '&amp;pRespApplId=', $pRespApplId, '&amp;pSecurityGroupID=', $pSecurityGroupID)"/> 
を評価したい変数用に別の引数を持つことができます
関連する問題