monster bob Posted September 29, 2006 Posted September 29, 2006 This is not exactly an XML/XSLT question but it is what I am using. Is there a straight-forward way to create a form to do a range search such as "start date" and "begin date" or "greater than X" and "less than Y"?
Martin Brändle Posted September 29, 2006 Posted September 29, 2006 Have a look at post http://www.fmforums.com/forum/showpost.php?post/166928/
monster bob Posted September 29, 2006 Author Posted September 29, 2006 Thanks for the information I found the site: http://www.clicaps.ethz.ch/fmi/xsl/search_advanced_en.xsl to be useful. It turns out they are using two fields such as "date" and "date_2". I'm guessing "date_2" is a calculation equal to "date". They are doing range searches by doing an "and" find on two separate fields. Alternatively I discovered that displaying the "date" field twice using a self-join works just as well and eliminates the need for creating extra fields and calculations.
Stephen.S. Posted September 30, 2006 Posted September 30, 2006 I haven't done any web design or used XML/XSL, etc., yet I'm wondering if you created a relationship that returns a range of records using Start_date and End_date if you could use that?
Martin Brändle Posted October 1, 2006 Posted October 1, 2006 I haven't done any web design or used XML/XSL, etc., yet I'm wondering if you created a relationship that returns a range of records using Start_date and End_date if you could use that? No you can't. What he needs is a user-defined, dynamic range.
Martin Brändle Posted October 1, 2006 Posted October 1, 2006 Thanks for the information I found the site: http://www.clicaps.ethz.ch/fmi/xsl/search_advanced_en.xsl to be useful. It turns out they are using two fields such as "date" and "date_2". I'm guessing "date_2" is a calculation equal to "date". They are doing range searches by doing an "and" find on two separate fields. No, "they" don't use two fields date and date_2. Or I misunderstood you and you mean something else. This is a general form where fields, operators, and values (up to three) can be mixed in any order (some JavaScript is used to dynamically change the input options, e.g. if ISBN is needed, the form is reduced to one field only, because ISBN is unique and no other criteria are needed). All the data (field names, operators and field values) are submitted to a database without any search, but stored. Then in a subsequent stylesheet, these intermediate values are taken and the final query is constructed. As said, if you seek a solution for a simple form, read the hint a gave in the cited post (either with field.op=bw and startdate...enddate or with field.op=bw and > and < added to the data).
monster bob Posted October 3, 2006 Author Posted October 3, 2006 I tried using the following example with no success: When I try to reference the same field name twice in a form I get an error.
Martin Brändle Posted October 3, 2006 Posted October 3, 2006 Remove one line , e.g. then it should work, as I have just found from a test file (with different range tests). I will submit the test file later (it's about a dozen different tests, and it's not yet finished).
Martin Brändle Posted October 4, 2006 Posted October 4, 2006 Here is a zip file with a quick and dirty DB and 4 XSLT files for doing tests on text, number, and date ranges. The tests are made with GET queries (URLs), but one can easily derive a POST query (a form) from them. test_ranges.zip
Recommended Posts
This topic is 6623 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now