I recently received an assignment that required the production of output produced from an SQL Server query as an XML...

I recently received an assignment that required the production of output produced from an SQL Server query as an XML document. Obtaining the data was no problem as I have worked with SQL Server, Datasnap an client datasets in the past. What gave me lots of problems was the XML output. Using XE7.

I used a DatasetProvider and XMLTransformClient to obtain the output. Also used the XML Mapping Tool as I was not given a schema, but rather "sample output." An auxiliary tool was also used, Aptana Studio 3 (open source, free).

The Mapping Tool creates a schema from an input XML file but in fact, the Schema will not validate; it contains errors. (It's also ugly, but that's a side issue.) Specifically, it generates invalid attributes at the Schema level and also generates duplicate global names.

My final Mapper workaround was:
1. Open XML (Schema generates)
2. Proceed with field definitions and mappings as needed
3. Generate data packet (this works as advertised and is used to create the ClientDatasets)
4. Generate the transform from XML to Datapacket (saved although not required for what I was doing)
4. Generate the transform from Datapacket to XML. Saved for use in final XML export)

After creating the final XML export the schema generated by the mapper is not usable because of the errors. I got around this by using another tool to generate a valid schema from the original XML. http://www.freeformatter.com/xsd-generator.html

I have not been able to find any mention of XML Mapper bugs in the customary places. My questions:

Has anyone run into this before?
Is it a bug or am I doing something wrong?

If it's a bug, how do we get it fixed?

TIA
http://www.freeformatter.com/xsd-generator.html

Comments