问题
I have a XSD file and when i try to conver this file using following code
public XmlDocument GetXml(XmlDocument xsd, XmlQualifiedName rootElem)
{
var reader = XmlReader.Create(new StringReader(xsd.OuterXml),new XmlReaderSettings
{
DtdProcessing = DtdProcessing.Prohibit
});
XmlSchema schema = XmlSchema.Read(reader, null);
var generator = new XmlSampleGenerator(schema, rootElem);
generator.MaxThreshold = 1;
var xmlStringBuilder = new StringBuilder();
var writer = XmlWriter.Create(xmlStringBuilder);
generator.WriteXml(writer);
var resultXmlDoc = new XmlDocument();
resultXmlDoc.LoadXml(xmlStringBuilder.ToString());
BlankOutValues(resultXmlDoc.DocumentElement);
return resultXmlDoc;
}
under the applicant i am setting a node employeetype like
but while converting all the field which is not contain all the values
while converting this with online tool it is working fine any idea?
enter image description here
under the node Time At Employer we have 2 fields but in other end it looks like an attribute!
来源:https://stackoverflow.com/questions/58165908/xsd-to-xml-conversion-not-contain-all-the-fields