XSLT PI 和样式表参数 [英] XSLT PI and StyleSheet Parameters

查看:36
本文介绍了XSLT PI 和样式表参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个需要参数的 XSLT 1.x 样式表,有没有办法将它与指定参数值的 XML 文档相关联?我阅读了样式表 PI 的 W3C 规范文档,留下的印象是答案是否定的,但在我完成时,我遇到了急性 BNF 中毒的情况,因此可能遗漏了一些东西.

Given an XSLT 1.x style sheet that requires parameters, is there any way to associate it with an XML document that specifies values for the parameters? I read the W3C spec document for the stylesheet PI and got left with the impression that the answer is 'no,' but I had a case of acute BNF poisoning by the time I was done, and thus might have missed something.

更具体地说,给定:

<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

有什么办法可以添加一些参数,这些参数会绑定到样式表的参数上吗?

is there any way to add some parameters that will be bound to parameters of the style sheet?

推荐答案

你的分析是正确的.xml-stylesheet PI 不提供将参数传递给 XSL 的方法.

Your analysis is correct. The xml-stylesheet PI provides no means to pass parameters to the XSL.

您可以简单地在包含您希望参数化的值的 XML 文档中添加一些额外的属性或元素.

You could simply add some additional attributes or elements in the XML document that contain the values you would want to paramaterise.

这篇关于XSLT PI 和样式表参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆