我必须创建一个带有选择的XSL变量.如下:
<xsl:variable name="grid_position">
<xsl:choose>
<xsl:when test="count(/Element) >= 1">
inside
</xsl:when>
<xsl:otherwise>
outside
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Run Code Online (Sandbox Code Playgroud)
后来在我的代码中,我做了一个xsl,如果:
<xsl:if test="$grid_position = 'inside'">
{...code...}
</xsl:if>
Run Code Online (Sandbox Code Playgroud)
问题是我的变量永远不会='内部',因为换行符和缩进.如何从变量中删除空格?我知道我可以disable-output-escaping="yes"在xsl:copy-of中使用它时将其删除,但它不适用于xsl:variable标记.那么如何删除那些空格和换行符呢?
我需要这样做:
<xsl:with-param name="callme" select="'validateInput(this,'an');'"/>
Run Code Online (Sandbox Code Playgroud)
我读过逃避XSLT concat函数单引号,它告诉我,以取代'与'我已经做了但其仍然没有工作..
有谁知道我们如何解决这个问题?:
<xsl:with-param name="callme" select="'validateInput(this,'an');'"/>
Run Code Online (Sandbox Code Playgroud) 我有以下代码似乎失败了.
<xsl:when test="$trialSiteName = 'Physician's Office'">
Run Code Online (Sandbox Code Playgroud)
此外,视觉工作室抱怨说
"期待的结束,找到了"
我怎么能逃脱这个角色?
我尝试了不同的方式,也环顾四周,但无法运行.我需要连接以下内容:
"concat(
'this is; \"a sample',
//XML_NODE,
'\"; \"using an apostrophe',
''',
'in text\"'
)"
Run Code Online (Sandbox Code Playgroud)
一行版本:
"concat( 'this is; \"a sample', //XML_NODE, '\"; \"using an apostrophe', ''', 'in text\"' )"
Run Code Online (Sandbox Code Playgroud)
输出应该是:
this is "a sample XML_NODE_VALUE"; "using an apostrophe ' in text"
Run Code Online (Sandbox Code Playgroud)
问题是'在文中.concat使用它来结束字符串并期望跟随; 或者结束.转义或HTML实体似乎都无法正常工作.
任何帮助都非常感谢.
谢谢!