Wayne Brissette
unread,Jun 17, 2020, 5:27:04 PM6/17/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nokogiri-talk
I have a situation where I have this:
<example>
<codeblock>
STCALIB[25] = 1'b0; // reference provided
</codeblock>
<codeblock>
STCALIB[24] = 1'b1; // skew
</codeblock>
<codeblock>
STCALIB[23:0] = (32768 x 10mS) -1
</codeblock>
</example>
What I need to do is combine the childnodes so I end up with this:
<example>
<codeblock>
STCALIB[25] = 1'b0; // reference provided
STCALIB[24] = 1'b1; // skew
STCALIB[23:0] = (32768 x 10mS) -1
</codeblock>
</example
The closest I can come is finding each codeblock element, getting the
next element, comparing the names of the two nodes, if they match
(<codeblock/><codeblock/>) then take the content of both, combining
those, deleting the second codeblock element, then replacing the initial
codeblock element with the combined text.
There has to be a better way to do this. Anybody know how to combine
siblings nodes that have the same node name?
Thanks,
Wayne