What is the role of xmlwritemode and xmlreadmode?

Source: Internet
Author: User
What is the role of xmlwritemode and xmlreadmode? Xmlwritemode enumeration is usually used as the second parameter of the dataset. writexml () method. It determines the format used to save XML: ignoreschema -- default value. Write only the data of the dataset without any architecture information. If there is no data in the dataset, no file is generated. Writeschema-Write the schema information of the dataset to The. XSD file while writing data to the. xml file. DiffGram -- write both the original data and the current data. So how can we make the correct choice between the xmlwritemode. writeschema mode and the xmlwritemode. DiffGram mode? You can use the xmlwritemode. writeschema mode to obtain an almost complete dataset, including the schema and data, but the data only has the current value. Xmlwritemode. DiffGram mode can obtain all values in the dataset, including the current value and original value. However, this mode does not have a dataset architecture. The specific mode depends on the purpose. If you want to fill in a new dataset with XML, all rows in the new dataset are completely clean, you should adopt the xmlwritemode. writeschema mode. If you want to transfer changes between different datasets using an XML file, you should select xmlwritemode. DiffGram mode. Xmlreadmode enumeration is usually used as the second parameter of the dataset. readxml () method. It determines how to read XML into the dataset: Auto -- default value. The best method for data gathering to try to read XML. DiffGram -- read DiffGram and apply the changes to dataset. Rowstate is retained. Fragment -- read XML documents. Any inline namespace will be read as the schema. It is mainly used to read standard XML documents. Ignoreschema-ignore the architecture and try to read XML into the existing dataset architecture. data that does not conform to the existing architecture is discarded. If the dataset does not have any architecture, all data is discarded. Inferschema -- ignore all XML schema information and deduce the Schema Based on XML data. Readschema -- read the inline schema information and data and try to add it to the dataset schema. An exception occurs if an architecture already exists in the dataset.

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.