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

Re^2: section nesting

by anniyan (Monk)
on Jul 26, 2005 at 05:02 UTC ( #478071=note: print w/ replies, xml ) Need Help??


in reply to Re: section nesting
in thread section nesting

GrandFather thanks for your assistance. Here the section closings are correctly nested.

<sec id="00005"><no>1.1</no> sfasfasdfadsfsdaf <sec id="00010"><no>1.1.1</no> sahfjsahdfasddfj </sec <sec id="00015"><no>1.1.2</no> sahfjsahdfasddfj <sec id="00020"><no>1.1.2.1</no> sahfjsahdfasddfj </sec> <sec id="00025"><no>1.1.2.2</no> safksajdklfasd </sec> </sec> <sec id="00015"><no>1.1.3</no> sahfjsahdfasddfj </sec> </sec> <sec id="00005"><no>1.2</no>....

This is bad example

<sec id="00005"><no>1.1</no> sfasfasdfadsfsdaf <sec id="00010"><no>1.1.1</no> sahfjsahdfasddfj </sec <sec id="00015"><no>1.1.2</no> sahfjsahdfasddfj </sec> #it should not be closed here (beca +use next sublevel is opening here) <sec id="00020"><no>1.1.2.1</no> sahfjsahdfasddfj </sec> <sec id="00025"><no>1.1.2.2</no> safksajdklfasd </sec> #that should be closed here <sec id="00015"><no>1.1.3</no> sahfjsahdfasddfj </sec> </sec> <sec id="00005"><no>1.2</no>....

Whereas here the second level section should close after third level is closed. This is wrong nesting. Actually the levels are identified by number with dots.

1.1 - first level 1.1.1 - second level (first section's sub level) 1.1.1.1 - third level (second section's sub level) 1.1.1.1.(i) - fourth level (third section's sub level) 1.1.1.1.(i).(a) - fifth level (fourth section's sub level)

Here the elements are same for all levels <sec, so parser not showing errors. If the elements are different for subsections like <sec, <sec1 , <sec2, the parser would have showed error. so here the nesting we are finding with the help of numbers 1.1, 1.1.1,...

updated

Regards,
Anniyan
(CREATED in HELL by DEVIL to s|EVILS|GOODS|g in WORLD)


Comment on Re^2: section nesting
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478071]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2015-07-30 12:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls