tags:

views:

114

answers:

1

i have this string

<div>
  <p><strong>Elem_A</strong>String_A2_2 <String_A2_2> asdas</p>
  <p><strong>Elem_B</strong>String_B2_2 String_B2_2</p>
</div>

and i want to covert it to

<div>
  <p><strong>Elem_A</strong>String_A2_2 <String_A2_2/> asdas</p>
  <p><strong>Elem_B</strong>String_B2_2 String_B2_2</p>
</div>

basically i want to autoclose any non html known tag , because i have problems with processing this html in htmlagilitypack as it changes the meaning of the html.

A: 
voyager
I think he meant XHTML, not HTML and doesn't care about entities that are valid in HTML/XHTML but entities that don't exist (such as <String_A2_2> -> <String_A2_2 />
Tegeril
@Tegeril: a custom DTD might help him if the parser relies on it to parse.
voyager
@Tegeril: one example http://java.sun.com/products/jfc/tsc/articles/bookmarks/
voyager
i want to do this programaticaly using some parser [c#]
Karim
i am not using special tags, but this special tags are basically unescapped text that was generated by error into the html
Karim