Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: section nesting

by Abigail-II (Bishop)
on Jun 22, 2004 at 15:54 UTC ( #368767=note: print w/replies, xml ) Need Help??


in reply to section nesting

What defines "improper" nesting? Your example suggests no nesting is allowed at all. Is that the case? Anyway, I'd use a single tokenizer and a counter. Whenever you see a <sec id = "..."> token, increment the counter. Whenever you see a </sec> token, decrement the counter. Whenver the counter has a value unequal to either 0 or 1, you have "improper nesting" - that is, assuming no nesting at all can happen.

Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://368767]
help
Chatterbox?
[atcroft]: Lady_Aleena: I considered it a violation of the principle of least surprise, but before I tried sending a message to the particular author (and perhaps make myself appear more foolish than normal), I wanted to find out if there was a more site-agnostic
[atcroft]: way (since I am guessing that MetaCPAN may be the author's preferred CPAN interface).

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-05-27 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?