从 xslt 在 href 中传递多个参数

发布于 2024-12-15 05:52:14 字数 219 浏览 2 评论 0原文

我正在通过 xslt 将 xml 文档转换为 html。我在传递多个参数时得到错误的输出。以下是代码:

<A href='index.html?id={str[2]}&classname={str[3]}'><xsl:value-of select="str[4]"/></A>

这适用于单个参数。有什么建议吗?

I am transforming an xml document to html by xslt. I am getting wrong output while passing multiple parameters in . Following is the code :

<A href='index.html?id={str[2]}&classname={str[3]}'><xsl:value-of select="str[4]"/></A>

this works with single parameter.any suggestions ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北城孤痞 2024-12-22 05:52:14

这不是一个格式良好的 XML 文档。

在格式良好的 XML 文档中,必须转义不在注释中或不用作实体引用名称开头的 & 字符。

这是正确的

<A href='index.html?id={str[2]}&classname={str[3]}'><xsl:value-of select="str[4]"/></A>
<A href='index.html?id={str[2]}&classname={str[3]}'><xsl:value-of select="str[4]"/></A>

This is not a well-formed XML document.

In a well-formed XML document, an & character that isn't in a comment or isn't used as a start of an entity-reference name, must be escaped.

This is correct:

<A href='index.html?id={str[2]}&classname={str[3]}'><xsl:value-of select="str[4]"/></A>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文