Nested tags
Björnke von Gierke
bvg at mac.com
Sun Jun 18 11:14:47 EDT 2006
you need to do something like this:
on mouseUp
repeat for each word theWord in theText
if theWord = "<SPAN" then
add one to x
else if theWord = "</SPAN>" then
if x = 1 then
--you found the right /span here
end if
subtract one from x
end if
end repeat
On Jun 18 2006, at 14:27, Terry Vogelaar wrote:
> Hi all,
>
> I've got a scripting problem that seems ridiculously simple.
>
> I have to find the corresponding end tag in a HTML file with nested
> <SPAN> tags:
>
> <SPAN class="FOOTNOTE">
> <SPAN Class="reference">
> origin
> </SPAN>
> <SPAN Class="quote">
> <SPAN Class="smallcaps">
> Text
> </SPAN>
> more text
> </SPAN>
> </SPAN>
>
> Some of the tags are nested. How do I find the end tag of each SPAN
> tag? The tag on line 1 has its end tag on line 11, but the first time
> it sees </SPAN> is on line 4...
>
> Terry
>
--
official ChatRev page:
http://chatrev.bjoernke.com
Chat with other RunRev developers:
go stack URL "http://homepage.mac.com/bvg/chatrev1.3.rev"
More information about the use-livecode
mailing list