By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

How to Insert Closing for Nested Elements

P: 2
Dear All,

I have an input without closing tags(only opening) e.g.,

input:
Expand|Select|Wrap|Line Numbers
  1. <index.level level="1" ref.id="001"><name>ADDRESSES</name>
  2. <index.level level="2"><name>Abel, I. W.</name> <locator punct.before=" ">34: A-4</locator><locator punct.before=", ">43: A-3</locator>
  3. <index.level level="2"><name>Abzug, Bella</name> <locator punct.before=" ">31: A-4</locator><locator punct.before=", ">48: A-11</locator>
  4. <index.level level="3"><name>Adams. Brock</name> <locator punct.before=" ">22: A-4</locator>
  5. <index.level level="4"><name>Albert, Carl</name> <locator punct.before=" ">36: A-9</locator>
output expected;
Expand|Select|Wrap|Line Numbers
  1. <index.level level="1" ref.id="001"><name>ADDRESSES</name>
  2. <index.level level="2"><name>Abel, I. W.</name> <locator punct.before=" ">34: A-4</locator><locator punct.before=", ">43: A-3</locator>
  3. </index.level><!--For index level 2-->
  4. <index.level level="2"><name>Abzug, Bella</name> <locator punct.before=" ">31: A-4</locator><locator punct.before=", ">48: A-11</locator>
  5. <index.level level="3"><name>Adams. Brock</name> <locator punct.before=" ">22: A-4</locator>
  6. <index.level level="4"><name>Albert, Carl</name> <locator punct.before=" ">36: A-9</locator>
  7. </index.level><!--For index level 4-->
  8. </index.level><!--For index level 3-->
  9. </index.level><!--For index level 2-->
  10. </index.level><!--And finally for index level 1-->
Please provide me some guidance to solve this problem.

Thanks,
Nov 17 '09 #1
Share this Question
Share on Google+
1 Reply


numberwhun
Expert Mod 2.5K+
P: 3,503
I am not 100% on what your question really is, but as far as nested tags go, you should always close them in the reverse order that you opened them, with the last one opened being the first one closed.

Regards,

Jeff
Nov 17 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.