我有以下字符串:
<table:table-cell table:style-name="Table2.A1" office:value-type="string">
<text:p text:style-name="P32">
<text:span text:style-name="T1">test description</text:span>
<text:span text:style-name="T2"> </text:span>
<text:span text:style-name="T1">17/07/2013</text:span>
<text:span text:style-name="T2"> </text:span>
<text:span text:style-name="T1">test</text:span>
<text:span text:style-name="T2"> </text:span>
<text:span text:style-name="T1">test</text:span>
<text:span text:style-name="T3"></text:span>
<text:span text:style-name="T1">test</text:span>
<text:span text:style-name="T3">test <!-- end tag is missing -->
</text:p>
</table:table-cell>
有没有办法找到未关闭的标签并插入它?
预期输出:
<table:table-cell table:style-name="Table2.A1" office:value-type="string">
<text:p text:style-name="P32">
<text:span text:style-name="T1">test description</text:span>
<text:span text:style-name="T2"> </text:span>
<text:span text:style-name="T1">17/07/2013</text:span>
<text:span text:style-name="T2"> </text:span>
<text:span text:style-name="T1">test</text:span>
<text:span text:style-name="T2"> </text:span>
<text:span text:style-name="T1">test</text:span>
<text:span text:style-name="T3"></text:span>
<text:span text:style-name="T1">test</text:span>
<text:span text:style-name="T3">test</text:span>
</text:p>
</table:table-cell>
提前致谢