使用节点集作为外部参数的 XSLT
我将 XML 节点传递给我的 JAVA 转换器:
transformer.setParameter("orset", qRes);
qRes 的内容与此类似:
<DOCTYPES>
<SUBTYPE>Passport</SUBTYPE>
<DOCTYPE>Proof of identity</DOCTYPE>
</DOCTYPES>
<DOCTYPES>
<SUBTYPE>Driving License</SUBTYPE>
<DOCTYPE>Proof of address</DOCTYPE>
</DOCTYPES>
我在 XSL 文件中声明了一个全局参数:
<xsl:param name="orset"/>
我可以从参数中访问特定值,如下所示:
<xsl:for-each SELECT="$orset/DOCTYPES">
<xsl:value-of select="$orset/DOCTYPES/DOCTYPE"/>
...
或者什么是正确的方法这样做?
非常感谢!
I'm passing XML nodes to my JAVA transformer:
transformer.setParameter("orset", qRes);
The contents of qRes is similar to this:
<DOCTYPES>
<SUBTYPE>Passport</SUBTYPE>
<DOCTYPE>Proof of identity</DOCTYPE>
</DOCTYPES>
<DOCTYPES>
<SUBTYPE>Driving License</SUBTYPE>
<DOCTYPE>Proof of address</DOCTYPE>
</DOCTYPES>
I have a global parameter declared in my XSL file:
<xsl:param name="orset"/>
Can I access specific values from the parameter something like this:
<xsl:for-each SELECT="$orset/DOCTYPES">
<xsl:value-of select="$orset/DOCTYPES/DOCTYPE"/>
...
Or what would be the proper way of doing this?
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您最好使用 eXslt 节点集函数...
根据您的处理器等,有可用的替代节点集函数,它们全部列在下面的参考中。
http://www.xml.com/pub/a/ 2003/07/16/nodeset.html
You are best to use the eXslt node-set function...
There are alternative node-set functions available based on your processor etc, they are all listed in the below reference.
http://www.xml.com/pub/a/2003/07/16/nodeset.html