I have been looking around for examples, but have yet to find anything that I feel fits my 'problem'
it's not really a problem, but I'm trying to find an easier way of populating this XML file.
it is quite large and is being used to interact with a courier system.
I have already built a working version in classic asp about a year ago, that basically treats the XML document as a large string and replace various node values.
I am updating to it, as i need to create it as a web service for some web apps I am developing in .net 2.0 in vis studio 2005
Pre amble over, lets get into it.
I have been trying to use an XSD to give me a object that i could populate and then apply to the XML document.
I know that i can set all the text I want by using the XmlElement and then pickout the relevant XmlNode and then populate it as follows
but to fully populate it i would need around 150 lines of code of the childNode type statements and am not that happy at Hard Coding the various positions of the specific nodes.
So my question as stated above is can I extract an object by creating an XSD and populate that object and then apply it to the XML.
May thanks in advance
it's not really a problem, but I'm trying to find an easier way of populating this XML file.
it is quite large and is being used to interact with a courier system.
I have already built a working version in classic asp about a year ago, that basically treats the XML document as a large string and replace various node values.
I am updating to it, as i need to create it as a web service for some web apps I am developing in .net 2.0 in vis studio 2005
Pre amble over, lets get into it.
I have been trying to use an XSD to give me a object that i could populate and then apply to the XML document.
I know that i can set all the text I want by using the XmlElement and then pickout the relevant XmlNode and then populate it as follows
Code:
XmlElement root = myxml.DocumentElement;
XmlNode request = root.SelectSingleNode("/Request");
request.ChildNodes.Item(0).InnerText = "this is test";
request.ChildNodes.Item(1).InnerText = _username;
request.ChildNodes.Item(1).InnerText = _password;
but to fully populate it i would need around 150 lines of code of the childNode type statements and am not that happy at Hard Coding the various positions of the specific nodes.
So my question as stated above is can I extract an object by creating an XSD and populate that object and then apply it to the XML.
May thanks in advance