[Zope] string comparison question

Rowan Hick rowan@softtech.co.nz
Fri, 25 Feb 2000 13:45:03 +1300


This is a multi-part message in MIME format.

------=_NextPart_000_0003_01BF7F96.84B464E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This is probably really dumb, but I can't figure out how to do the
following:

Compare the ntype variable in the following code with a straight boring old
string eg "BLOCKQUOTE"

eg if nytpe = blockquote, then print text_content() in italics..

     <dtml-in "getChildNodes()">
       <dtml-let ntype="getNodeName()">
          <dtml-if  ...condition..... >
             print something
           </dtml-if>
        </dtml-let>
      </dtml-in>

I've looked through the DTML help file but it's confused me more than
anything else, I'm guessing I need to use the
find(S, SUB[, START])    syntax as part of the string module

But I can't figure it out.. there's no examples in the help of string
comparison functions and what this _ business is all about, I'm sure after I
see an example it will all become quite clear, but for the life of me I just
can't get it sorted..

Helllllpppppp!!!!


Rowan Hick
Business Analyst,
Soft Tech NZ LTD
www.softtechnz.com

------=_NextPart_000_0003_01BF7F96.84B464E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D180113100-25022000>This =
is probably=20
really dumb, but I can't figure out how to do the =
following:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D180113100-25022000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D180113100-25022000>Compare the ntype=20
variable in the following code with a straight boring old string eg=20
"BLOCKQUOTE"</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D180113100-25022000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D180113100-25022000>eg if =
nytpe =3D=20
blockquote, then print text_content() in italics..</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D180113100-25022000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D180113100-25022000>&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-in=20
"getChildNodes()"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;dtml-let=20
ntype=3D"getNodeName()"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
&lt;dtml-if&nbsp; ...condition..... &gt;</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D180113100-25022000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;=20
print =
something<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
&lt;/dtml-if&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/dtml-let&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/dtml-in&gt;</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D180113100-25022000></SPAN></FONT>&nbsp;</DIV>
<DIV><SPAN class=3D180113100-25022000><FONT face=3DArial size=3D2>I've =
looked through=20
the DTML help file but it's confused me more than anything else, I'm =
guessing I=20
need to use the </FONT>
<P class=3DCellBody><A name=3DpgfId-1046783></A><FONT size=3D2><FONT =
face=3DArial><EM=20
class=3DEmphasis>find(S, SUB[, START])</EM>&nbsp;<SPAN=20
class=3D180113100-25022000><EM>&nbsp;&nbsp; </EM>syntax as part of the =
string=20
module </SPAN></FONT></FONT></P>
<P class=3DCellBody><FONT size=3D2><FONT face=3DArial><SPAN=20
class=3D180113100-25022000>But&nbsp;I can't figure it out.. there's no =
examples in=20
the help of string comparison functions and what this _ business is all =
about,=20
I'm sure after I see an example it will all become quite clear, but for =
the life=20
of me I just can't get it sorted..</SPAN></FONT></FONT></P>
<P class=3DCellBody><FONT size=3D2><FONT face=3DArial><SPAN=20
class=3D180113100-25022000>Helllllpppppp!!!!</SPAN></FONT></FONT></P></SP=
AN></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Rowan Hick</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Business Analyst,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Soft Tech NZ LTD</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"http://www.softtechnz.com/">www.softtechnz.com</A></FONT></DIV></=
BODY></HTML>

------=_NextPart_000_0003_01BF7F96.84B464E0--