troubleshooting Question

Problem nesting following sibling element

Avatar of kmartin7
kmartin7Flag for United States of America asked on
Web Languages and Standards
7 Comments1 Solution277 ViewsLast Modified:
I am having fits trying to grab a following sibling and nest it within the preceding sibling. I have had it work partially, but can't quite get it to work 100%. Below is a sample snippet of XML. I need to grab <ol> elements that are following siblings of an <li> element and nest it into the <li> element. So I need the following:

<body>
      <ol>
            <li>1.      Shut down equipment and lock out power in accordance with current local lockout procedure.</li>
            <li>2.      Remove conveyor side covers.</li>
            <li>3.      Turn main disconnect switch to Off position.</li>
            <li>4.      Loosen only conveyor idler rollers and O-belts being replaced. (For power roller replacement see<xref href="i0eg0211.dita#37286">Figure 1-26</xref> and<xref href="i0eg0211.dita#39450">Paragraph 1.12.3.4</xref>.)</li>
      </ol>
      <ol>
            <li>5.      Starting on opposite end from O-belt, grasp roller and press end of spring-loaded shaft with screwdriver or punch to release shaft from conveyor (<xref href="i0eg0211.dita#36782">Figure 1-25</xref>).<ol class="proc2"><li>
                              5.      Starting on opposite end from O-belt, grasp roller and press end of spring-loaded shaft with screwdriver or punch to release shaft from conveyor (<xref href="i0eg0211.dita#36782">Figure 1-25</xref>).</li></ol></li>
            <li>6.      To remove rollers from other than output zone right angle transfer assembly:</li>
            <ol>
                  <li>a.      Move roller slightly downward while pulling it free of opposite side wall mounting hole (<xref href="i0eg0211.dita#37286">Figure 1-26</xref>).</li>
                  <li>b.      Carefully pull roller through O-belts and remove from bottom of conveyor (<xref href="i0eg0211.dita#37286">Figure 1-26</xref>).</li>
            </ol>
            <li>7.      To remove rollers from output zone:</li>
            <ol>
                  <li>a.      Move roller slightly upward while pulling it free of opposite side wall mounting hole (<xref href="i0eg0211.dita#98470">Figure 1-27</xref>).</li>
                  <li>b.      Carefully pull roller through O-belts and remove from top of conveyor (<xref href="i0eg0211.dita#98470">Figure 1-27</xref>).</li>
            </ol>
            <li>8.      Loosen adjacent rollers as necessary and remove O-belts (<xref href="i0eg0211.dita#77287">Figure 1-28</xref>), moving rollers upward or downward depending on conveyor zone.</li>
      </ol>
</body>

To look like this:

<body>
      <ol>
            <li>1.      Shut down equipment and lock out power in accordance with current local lockout procedure.</li>
            <li>2.      Remove conveyor side covers.</li>
            <li>3.      Turn main disconnect switch to Off position.</li>
            <li>4.      Loosen only conveyor idler rollers and O-belts being replaced. (For power roller replacement see<xref href="i0eg0211.dita#37286">Figure 1-26</xref> and<xref href="i0eg0211.dita#39450">Paragraph 1.12.3.4</xref>.)</li>
      </ol>
      <ol>
            <li>5.      Starting on opposite end from O-belt, grasp roller and press end of spring-loaded shaft with screwdriver or punch to release shaft from conveyor (<xref href="i0eg0211.dita#36782">Figure 1-25</xref>).<ol class="proc2"><li>
                              5.      Starting on opposite end from O-belt, grasp roller and press end of spring-loaded shaft with screwdriver or punch to release shaft from conveyor (<xref href="i0eg0211.dita#36782">Figure 1-25</xref>).</li></ol></li>
            <li>6.      To remove rollers from other than output zone right angle transfer assembly:
            <ol>
                  <li>a.      Move roller slightly downward while pulling it free of opposite side wall mounting hole (<xref href="i0eg0211.dita#37286">Figure 1-26</xref>).</li>
                  <li>b.      Carefully pull roller through O-belts and remove from bottom of conveyor (<xref href="i0eg0211.dita#37286">Figure 1-26</xref>).</li>
            </ol></li>
            <li>7.      To remove rollers from output zone:
            <ol>
                  <li>a.      Move roller slightly upward while pulling it free of opposite side wall mounting hole (<xref href="i0eg0211.dita#98470">Figure 1-27</xref>).</li>
                  <li>b.      Carefully pull roller through O-belts and remove from top of conveyor (<xref href="i0eg0211.dita#98470">Figure 1-27</xref>).</li>
            </ol></li>
            <li>8.      Loosen adjacent rollers as necessary and remove O-belts (<xref href="i0eg0211.dita#77287">Figure 1-28</xref>), moving rollers upward or downward depending on conveyor zone.</li>
      </ol>
</body>

Here is the original code.

TIA

kmartin7
<body>
	<ol>
		<li>1.	Shut down equipment and lock out power in accordance with current local lockout procedure.</li>
		<li>2.	Remove conveyor side covers.</li>
		<li>3.	Turn main disconnect switch to Off position.</li>
		<li>4.	Loosen only conveyor idler rollers and O-belts being replaced. (For power roller replacement see<xref href="i0eg0211.dita#37286">Figure 1-26</xref> and<xref href="i0eg0211.dita#39450">Paragraph 1.12.3.4</xref>.)</li>
	</ol>
	<ol>
		<li>5.	Starting on opposite end from O-belt, grasp roller and press end of spring-loaded shaft with screwdriver or punch to release shaft from conveyor (<xref href="i0eg0211.dita#36782">Figure 1-25</xref>).<ol class="proc2"><li>
					5.	Starting on opposite end from O-belt, grasp roller and press end of spring-loaded shaft with screwdriver or punch to release shaft from conveyor (<xref href="i0eg0211.dita#36782">Figure 1-25</xref>).</li></ol></li>
		<li>6.	To remove rollers from other than output zone right angle transfer assembly:</li>
		<ol>
			<li>a.	Move roller slightly downward while pulling it free of opposite side wall mounting hole (<xref href="i0eg0211.dita#37286">Figure 1-26</xref>).</li>
			<li>b.	Carefully pull roller through O-belts and remove from bottom of conveyor (<xref href="i0eg0211.dita#37286">Figure 1-26</xref>).</li>
		</ol>
		<li>7.	To remove rollers from output zone:</li>
		<ol>
			<li>a.	Move roller slightly upward while pulling it free of opposite side wall mounting hole (<xref href="i0eg0211.dita#98470">Figure 1-27</xref>).</li>
			<li>b.	Carefully pull roller through O-belts and remove from top of conveyor (<xref href="i0eg0211.dita#98470">Figure 1-27</xref>).</li>
		</ol>
		<li>8.	Loosen adjacent rollers as necessary and remove O-belts (<xref href="i0eg0211.dita#77287">Figure 1-28</xref>), moving rollers upward or downward depending on conveyor zone.</li>
	</ol>
</body>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros