Filter data in XSLT-filter data accurate to the current time

Source: Internet
Author: User
Tags xslt

Original, reprinted please indicate the source! Thank you!

In actual work, the customer requires that the information be filtered out at the specified time point. That is, if a piece of information is set to be published at, the data will not be filtered out before.

In fact, the requirement is very simple. Add a filtering condition in the designer to set the release time to be less than or equal to the current time. However, when using the designer + xslt, you will find that you can only select the current date, and the time selection function is not provided.

Later I studied the code generated by the system and found that it is actually a CAML query statement.

I tried it with the CAML tool and found that the time can be accurate.

 

So I think the time can also be selected in xslt. I replaced the query statement in xslt with the statement generated by the CAML tool.

The result is a failure and no data is found. It seems that xslt does not support "Now" usage. Later, I still use Today, but keep the IncludeTimeValue attribute. The result is successful! That is, the query statement of xslt is

Remember to replace all the symbols. Otherwise, an error will be reported in xslt.

Filter data in XSLT-filter data accurate to the current time

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.