我需要使用日期时间排序,并且我只想要该节点的最新内容
<Note NoteText="TestOrder">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-07T07:02:53+00:00"/>
</Note>
<Note NoteText="TestOrder1">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-08T07:02:53+00:00"/>
</Note>
<Note NoteText="TestOrder2">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-09T18:02:53+00:00"/>
</Note>
<Note NoteText="TestOrder3">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-10T17:02:53+00:00"/>
</Note>
首先,我想从 Datetime 属性中找到最新的 Datetime,并且我想使用 xslt 将这些最新属性传输到另一个属性。
city-C1
Address-A1
Response-R1
Devicename-D1
Datetime-DT
请帮助我继续
<Note NoteText="TestOrder">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-07T07:02:53+00:00"/>
</Note>
<Note NoteText="TestOrder1">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-08T07:02:53+00:00"/>
</Note>
<Note NoteText="TestOrder2">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-09T18:02:53+00:00"/>
</Note>
<Note NoteText="TestOrder3">
<test City="abc" Address="abc"
Response="abc" Devicename="abc"
DateTime="2011-02-10T17:02:53+00:00"/>
</Note>
Here first i want to find the latest Datetime from Datetime attribute and i want to transfer those latest attributes to another attribute using xslt.
city-C1
Address-A1
Response-R1
Devicename-D1
Datetime-DT
Please help me to proceed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此转换:
应用于提供的 XML 文档时:
产生所需的正确结果:
This transformation:
when applied on the provided XML document:
produces the wanted, correct result:
XSLT 1.0 样式表:
输出:
注意:只要没有不同的时区,它就可以工作。
XSLT 1.0 stylesheet:
Output:
Note: It works as long as there is no different time zone.