Xml parsing tags and xml Parsing
1 // obtain the value of 2 private static string GetStr (string message, string strStart, string strEnd) between two tags 3 {4 int start = 0; 5 int end = 0; 6 start = message. indexOf (strStart); 7 if (start <0) return ""; 8 end = message. substring (start + strStart. length ). indexOf (strEnd); 9 if (end> = 0) 10 {11 return message. substring (start + strStart. length, end); 12} 13 return ""; 14}
What should I do if I encounter empty tags during XML parsing?
What is the author's explanation?
C # parses xml in System. there is a special Xml class in the xml space. You can use xpath to obtain xml elements (the tag you are referring to). If it is empty, the text value of the tag is "".
Who used Xstream to generate xml with cdata labels to parse xml with cdata labels?
In XML, CDATA indicates that internal data is not escaped, that is, characters such as <,> are not interpreted.
When parsing such xml, the interpreter reads its content as is without any special processing.