doesn't it just kill you the way that people attempt to design and develop applications that are "totally dynamic" and "won't ever need to be recompiled"?!?!?
well, it kills me anyway.
here is the current scenario ::
step 01: select rows from db matching criteria < for xml auto >
step 02: start a StringBuilder with "<root>"
step 03: loop through rows returned from db, appending each to the StringBuilder
step 04: finish the StringBuilder with "</root>"
step 05: create an XmlTextReader and pass the .ToString() method of the StringBuilder to it
step 06: create an XPathDocument from the XmlTextReader
step 07: (since the xml from the db is not in the correct format...) create an XslCompiledTransform.
step 08: pass in a few params that the "new" xml will need.
step 09: use the .Tranform() method to create the "new" xml.
step 10: read stream passed to .Transform() into a string
step 11: use the .Replace() method to replace the empty namespace created by .Transform() with nothing
step 12: post string to webservice.
(whew!)
my proposal ::
step 01: select rows from db matching criteria and return a datatable
step 02: create an XmlDocument
step 03: add a root node
step 04: loop through the datatable adding a child node for each record.
step 05: post XmlDocument.OuterXml() to the webservice.
so i ask my boss, why do we have xml coming back from the db if it's not even in the format we want? i mean, since we have to transform that xml with xslt anyway why not just return either
1) the XML in the correct format
or
2) a datatable and then turn that into xml?
he says ... this way *when* they change the schema, we only have to change the xslt.
and i'm like, but you are using the xsd.exe tool to generate the serialize/deserialize class ... so *when* they change the schema you are gonna have to recompile anyway because those classes are gonna need to be redone
and he's like, yeah, but those are generated by the xsd.exe tool so it's really no work. (ever use the Xsd.exe tool? i wouldn't call it "no work")
but - i think to myself - your original argument was that with xslt you wouldn't have to recompile, and here you are saying that you WILL have to recompile - so you've just defeated your own argument
you are doing my work for me!
anway ...
</rant>