开发者

Validate dataset using XSD file

开发者 https://www.devze.com 2023-04-06 12:15 出处:网络
I have XML file and i am genrating Datset from it DataSet ds = new DataSet(); ds.ReadXml(new XmlTextReader(new StringReader(strMasterSqlXML))); //strMasterSqlXML is XML string

I have XML file and i am genrating Datset from it

DataSet ds = new DataSet();
ds.ReadXml(new XmlTextReader(new StringReader(strMasterSqlXML))); //strMasterSqlXML is XML string

I have XSD file and i want to validate that dataset se开发者_运维技巧t by XSD file to check datatype and relations, if it's possible by direct xml validation or by dataset i am ready to implemt.

Give me idea...


Try looking into JAXB. From your xsd it will generate java classes that you can uses to populate your dataset with simple methods. From there you can validate and write to an XML file with ease.

jaxb.java.net

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号