gpt4 book ai didi

xslt - xslt中多次出现相同的路径

转载 作者:行者123 更新时间:2023-12-03 17:17:35 25 4
gpt4 key购买 nike

我正在定义几个变量,并且其中包含select="-------"。在那些路径的第一部分是相同的。有什么办法可以定义某种事物的恒定类型,以便我可以使用它而不必一遍又一遍地重新键入相同的事物?

最佳答案

好吧,你可以使用一个变量

<xsl:variable name="foo" select="/a/b/foo"/>
<xsl:variable name="bar" select="$foo/bar"/>
<xsl:variable name="foobar" select="$foo/foobar"/>


代替

<xsl:variable name="bar" select="/a/b/foo/bar"/>
<xsl:variable name="foobar" select="/a/b/foo/foobar"/>


但是由于您已经在使用看起来太明显的变量,所以也许我错过了问题所在。

关于xslt - xslt中多次出现相同的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11415723/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com