Xml parsing tags and xml Parsing

Source: Internet
Author: User

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.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.