[Zope] lines property
Kevin Howe
khowe@performance-net.com
Wed, 6 Oct 1999 15:59:47 -0300
This is a multi-part message in MIME format.
------=_NextPart_000_0123_01BF1013.D0758910
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi, I currently have a lines property with a ZOPE path on each line, and =
the following statement which works:
"Paths" Lines Property
-----------------------------
/path/one
/path/two
DTML Code
----------------------------
<!--#if "_['sequence-item'] =3D=3D PATH_INFO "-->
Match - <!--#var sequence-item--><br>
<!--#else-->
No Match - <!--#var sequence-item--><br>
<!--#/if-->
In this case, there is a match if the current Zope PATH_INFO is equal to =
"/path/one" or "/path/two", exact matches only. A path of =
"/path/one/folder/" is not a match, because it's not exact.
What I would like to do a substring search for a match, instead of a =
full comparison, something like this:
<!--#if "PATH_INFO (STARTS WITH) _['sequence-item']"-->
Match - <!--#var sequence-item--><br>
<!--#else-->
No Match - <!--#var sequence-item--><br>
<!--#/if-->
In this example, a PATH_INFO of "/path/one/folder" would be a match, =
beause it starts with "/path/one", which is one of the given values.
I tried playing with the Python search() and match() functions, but =
couldnt get them to work.=20
Can someone tell me how/if this type of matching can be done?
Much appreciated,
KH
------=_NextPart_000_0123_01BF1013.D0758910
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN">
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi, I currently have a lines property with a ZOPE =
path on each=20
line, and the following statement which works:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>"Paths" Lines =
Property</FONT></DIV>
<DIV><FONT size=3D2></FONT><FONT color=3D#000000=20
size=3D2>-----------------------------</FONT></DIV>
<DIV><FONT size=3D2>/path/one</FONT></DIV>
<DIV><FONT size=3D2>/path/two</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>DTML Code</FONT></DIV>
<DIV><FONT size=3D2></FONT><FONT color=3D#000000=20
size=3D2>----------------------------</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><!--#if "_['sequence-item'] =
=3D=3D PATH_INFO=20
"--><BR> Match - <!--#var=20
sequence-item--><br><BR><!--#else--><BR> No =
Match -=20
<!--#var =
sequence-item--><br><BR><!--#/if--></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>In this case, there is a match if =
the current=20
Zope PATH_INFO is equal to "/path/one" or =
"/path/two", exact=20
matches only. A path of "/path/one/folder/" is not a match, =
because=20
it's not exact.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#000000 size=3D2>What I would like to do a substring =
search for a=20
match, instead of a full comparison, something like this:</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>
<DIV><FONT color=3D#000000 size=3D2><!--#if "PATH_INFO (STARTS =
WITH)=20
_['sequence-item']"--><BR> Match - <!--#var=20
sequence-item--><br><BR><!--#else--><BR> No =
Match -=20
<!--#var =
sequence-item--><br><BR><!--#/if--></FONT></DIV>
<DIV> </DIV>
<DIV>In this example, a PATH_INFO of "/path/one/folder" would =
be a=20
match, beause it starts with "/path/one", which is one of the =
given=20
values.</DIV>
<DIV> </DIV>
<DIV>I tried playing with the Python search() and match() functions, but =
couldnt=20
get them to work. </DIV>
<DIV>Can someone tell me how/if this type of matching can be done?</DIV>
<DIV> </DIV>
<DIV>Much appreciated,</DIV>
<DIV>KH</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0123_01BF1013.D0758910--