xsl-list
[Top] [All Lists]

Closest matching value

2004-05-10 12:48:57
Hello,

I've scoured the Web and these archives for a solution to this problem, all
to no avail I'm afraid.

My source dosument looks like this

<root>
 <domain>
  <url>http://localhost:8080/site1</url>
  <url>http://www.domain.com</url>
  <controller>members\www1\site1</controller>
 </domain>
 <domain>
  <url>http://localhost:8080/site2</url>
  <controller>members\www2\site2</controller>
 </domain>
 <domain>
  <url>http://localhost:8080/site2/folder1</url>
  <controller>members\www3</controller>
 </domain>
</root>

My xsl doc contains a variable holding the Request URI. I want to select the
controller in the domain which contains the closest matching url value (url
values are unique) for the Request URI.

For example,

If RequestURI = http://localhost:8080/site2/folder1/page/page/page)
Then controller = members\www3.

If RequestURI = http://localhost:8080/site2)
Then controller = members\www2\site2

etc....

Thanks for reading, any help would be very much appreciated.


Stuart




<Prev in Thread] Current Thread [Next in Thread>