Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: xslt 2.0 getting two points of a list for interpolation xslt 2.0 getting two points of a list for interpolationTo: NULL Date: 12/12/2008 9:05:00 AM Dear ALL, does anybody have a solution for this: I have a set of points (you can imagine a poly line) decribed this way. <?xml version="1.0" encoding="UTF-8"?> <Line> <P X="10" Y="1.0"/> <P X="20" Y="2.1"/> <P X="30" Y="2.2"/> <P X="40" Y="4.3"/> <P X="50" Y="4.4"/> <P X="60" Y="3.5"/> </Line> What I want is to create a function which returns the Y value based on an X value. Easy, in case the X value exists. If not, I have to search the 2 nearest points and next calculate Y. I can assume that the X value is in the range of Xmin and Xmax of the point data set. What is the best code (XSLT2.0) to find the two nearest points for a given X ? (I have the feeling that a for-each-group may do, but this may be wrong) Any help is welcome Rolf | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
