Sorry, my mistake. The IXmlSerializable is supported by the 1.1 Frameworks.
But implementing the WriteXml() for all the derived DataSet is not that
trivial.
Hi Sharon,
Here are some code samples for IXmlSerializable.
http://www.devx.com/dotnet/Article/29720/1763
http://www.developerfusion.co.uk/show/4639/
HTH.
Kevin Yu
Microsoft Online Community Support
==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Sharon - 24 Aug 2006 11:26 GMT
Thanks for your post and email.
There is too much work to implement the WriteXml() of the IXmlSerializable,
the DataSet structure is not that simple.
Furthermore, I'm writing a library function that should return a string
containing the DataSet content in a XML format.
I guess that maybe the XML parser version is different in that specific
laptop, so for now I added the following code when saving the string it to a
file:
// Anyhow I need the XmlDocument for another peace of code out of our scope.
XmlDocument doc = new XmlDocument();
doc.LoadXml( m_filterHandler.GetXmlDB() );
XmlNode node = doc.SelectSingleNode(".../ImageOrigin");
if( node != null && node.ChildNodes.Count == 2 )
{ // In case the pontF is in the unwanted format <ImageOrigin
...><X>1.2</X><Y>3.4</Y></ImageOrigin>
node.RemoveAll();
node.InnerXml = ptf.ToString(); // will make it: <ImageOrigin>{X=1.2,
Y=3.4}</ImageOrigin>
}
.... // some other peace of code out of our scope.
doc.Save("MyFileName.xml");
This fix does the job.
But still; I do not know why the difference exists as I already described in
my previous post. Do you ???
------
Thanks
Sharon
Kevin Yu [MSFT] - 25 Aug 2006 06:42 GMT
Hi Sharon,
I'm sorry, since I didn't reproduced this on my machine, I don't know how
this happens, either. Anyway, it was nice to know that you have had a
workaround to this problem. If you have any questions, please feel free to
post them int eh community.
Kevin Yu
Microsoft Online Community Support
==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Sharon - 24 Aug 2006 11:53 GMT
Thanks for your post and email.
There is too much work do for implement the WriteXml() of the
IXmlSerializable, the DataSet structure is not that simple.
Furthermore, I'm writing a library function that should return a string
containing the DataSet content in a XML format.
I guess that maybe the XML parser version is different in the specific
laptop, so for now I have added the following code when saving the string to
a file:
PointF ptf = new Pointf(1.2, 3.4);
// Anyhow I need the XmlDocument for another peace of code out of our scope.
XmlDocument doc = new XmlDocument();
doc.LoadXml( m_dataSet.GetXmlDB() );
XmlNode node = doc.SelectSingleNode(".../ImageOrigin");
if( node != null && node.ChildNodes.Count == 2 )
{ // In case the pointF is in the unwanted format: <ImageOrigin
...><X>1.2</X><Y>3.4</Y></ImageOrigin>
node.RemoveAll();
node.InnerXml = ptf.ToString(); // will make it: <ImageOrigin>{X=1.2,
Y=3.4}</ImageOrigin>
}
.... // some other peace of code out of our scope.
doc.Save("MyFileName.xml");
This fix does the job.
But still; I do not know why the difference exists as I already described in
my previous post. Do you ???
------
Thanks
Sharon
Sharon G. - 24 Aug 2006 11:54 GMT
Thanks for your post and email.
There is too much work do for implement the WriteXml() of the IXmlSerializable, the DataSet structure is not that simple.
Furthermore, I'm writing a library function that should return a string containing the DataSet content in a XML format.
I guess that maybe the XML parser version is different in the specific laptop, so for now I have added the following code when saving the string to a file:
PointF ptf = new Pointf(1.2, 3.4);
// Anyhow I need the XmlDocument for another peace of code out of our scope.
XmlDocument doc = new XmlDocument();
doc.LoadXml( m_dataSet.GetXmlDB() );
XmlNode node = doc.SelectSingleNode(".../ImageOrigin");
if( node != null && node.ChildNodes.Count == 2 )
{ // In case the pointF is in the unwanted format: <ImageOrigin ...><X>1.2</X><Y>3.4</Y></ImageOrigin>
node.RemoveAll();
node.InnerXml = ptf.ToString(); // will make it: <ImageOrigin>{X=1.2, Y=3.4}</ImageOrigin>
}
.... // some other peace of code out of our scope.
doc.Save("MyFileName.xml");
This fix does the job.
But still; I do not know why the difference exists as I already described in my previous post. Do you ???
------
Thanks
Sharon
Sharon G. - 24 Aug 2006 11:54 GMT
Thanks for your post and email.
There is too much work do for implement the WriteXml() of the IXmlSerializable, the DataSet structure is not that simple.
Furthermore, I'm writing a library function that should return a string containing the DataSet content in a XML format.
I guess that maybe the XML parser version is different in the specific laptop, so for now I have added the following code when saving the string to a file:
PointF ptf = new Pointf(1.2, 3.4);
// Anyhow I need the XmlDocument for another peace of code out of our scope.
XmlDocument doc = new XmlDocument();
doc.LoadXml( m_dataSet.GetXmlDB() );
XmlNode node = doc.SelectSingleNode(".../ImageOrigin");
if( node != null && node.ChildNodes.Count == 2 )
{ // In case the pointF is in the unwanted format: <ImageOrigin ...><X>1.2</X><Y>3.4</Y></ImageOrigin>
node.RemoveAll();
node.InnerXml = ptf.ToString(); // will make it: <ImageOrigin>{X=1.2, Y=3.4}</ImageOrigin>
}
.... // some other peace of code out of our scope.
doc.Save("MyFileName.xml");
This fix does the job.
But still; I do not know why the difference exists as I already described in my previous post. Do you ???
------
Thanks
Sharon