This is all well and good, but it produces such a messy xml file.
What i want to do is convert it to a simple xml file, so that i can
read the file into a dataset in vb.net.
Any ideas how to do this?
Thanks
'Put the data from the dataset into an XmlDataDocument ...
System.Xml.XmlDataDocument objSource = new
System.Xml.XmlDataDocument(objDataset);
'Transform the data from the Dataset 'DiffGram' schema to the ADODB
schema ...
System.Xml.Xsl.XslTransform objTransform = new
System.Xml.Xsl.XslTransform();
System.String strTransform =
System.Configuration.ConfigurationSettings.AppSettings["transform"];
objTransform.Load(strTransform);
System.IO.StringWriter sw = new System.IO.StringWriter();
objTransform.Transform(objSource, null, sw, new
System.Xml.XmlUrlResolver());
sw.Close();
strResult = sw.ToString();
'ADODB has a problem with the <z:row ...></z:row> format, need to change
to abbreviated <z:row ... /> format.
strResult = System.Text.RegularExpressions.Regex.Replace(strResult,
">\\W*</z:row>", "/>");
return strResult;
}
I won't post the XSLT here (this is the document reffered to via
AppSettings["transform"] in the code above) unless you particularly want to
see it, because it is quite long, and because, transforming as it does
*from* DiffGram *to* the ADODB schema, I don't think it would be
particularly usefull to you. If you still want to see it, though, just ask
and I'll post it.
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
"samo" <samo...@hotmail.com> wrote in message
news:31db119e.04101...@posting.google.com...
you have 2 solution:
get the transformnode xml stream in xml stream onject or DOM object or
use tranformnodetoobject to make it
and save your xmlDom in your dataset.
i'm not working with DotNet at this time but i'm make the same for change
the recordset saved as XML for use it in dataisland.....
i hope to help you
@+
Boss Hog
"Brendan Reynolds" <brenreyn at indigo dot ie> a écrit dans le message de
news: %23fWLPyE...@TK2MSFTNGP14.phx.gbl...