显示热门

阅读顺序

深色模式

字体大小|

搜索
ADVERTISEMENT
返回
  • 浏览过的版块

1
ADVERTISEMENT
Huaren
等级大校
威望22
贴子17028
魅力17450
注册时间@2013-08-09

iceox

只看楼主

XSL 问题请教, 谢谢!

1953

4

2004-04-12 08:46:00

我想这栏应该最火了, 别的栏也没有适合我贴这个的, 就放这了, 如果有会的, 请指点下, 谢谢


我有个 XML 文件, 内容包括像:
http://www.w3schools.com/xsl/cdcatalog.xml
但如果这 XML 文件没有 Record, 像,


我想写 "No record found". 有用 XSL 写的办法么?

我可以用 Jsp or java 写出 "No record found" faking xml data, 但是请问有没有直接用 xsl 写出 “No record found” 的? 我查了, xsl:when, xsl:otherwise 和我的情况不符合。

谢谢


[此贴子已经被作者于2004-4-12 8:49:38编辑过]

Huaren
等级大校
威望22
贴子17028
魅力17450
注册时间@2013-08-09

coldhan

只看他

2004-04-12 15:07:00

you should put it under 电脑世界吧?
Huaren
等级大校
威望22
贴子17028
魅力17450
注册时间@2013-08-09

cathylan

只看他

2004-04-13 03:32:00

三年前写过的XSL了,不知道对不对。
总之,可以用xsl:variable拿到/catalog/cd的value,然后用xsl:if来test这个value是不是empty string.

Huaren
等级大校
威望22
贴子17028
魅力17450
注册时间@2013-08-09

iceox

只看楼主

2004-04-13 08:34:00

以下是引用cathylan在2004-4-13 3:32:23的发言:
三年前写过的XSL了,不知道对不对。
总之,可以用xsl:variable拿到/catalog/cd的value,然后用xsl:if来test这个value是不是empty string.





I was thinking about that too, thought about the otherwise also, but if variable such as
Huaren
等级大校
威望22
贴子17028
魅力17450
注册时间@2013-08-09

cathylan

只看他

2004-04-13 18:44:00



If you just want to insert "No Record Found" in the XML input file as the value of tag




以下是引用iceox在2004-4-13 8:34:13的发言:
以下是引用cathylan在2004-4-13 3:32:23的发言:
三年前写过的XSL了,不知道对不对。
总之,可以用xsl:variable拿到/catalog/cd的value,然后用xsl:if来test这个value是不是empty string.





I was thinking about that too, thought about the otherwise also, but if variable such as
初始化编辑器...

到底了