By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,900 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,900 IT Pros & Developers. It's quick & easy.

ReadInnerXml()

P: n/a

Hello,
I have a class which reads xml and has to pass to another class(by
making an instance of it and activating it constractor) a part of this
xml that the next class could read it.
I am doing it with ReadInnerXml() but my question is which variable can
contain the result of this function in order to pass it as an xml file
to the following clas?
Thank you very much!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
juli,

You could use a System.Xml.XmlDocument.
XmlDocument doc = new XmlDocument();
// Be aware that ReadInnerXml could potentially return multiple nodes
// and in that case XmlDocument.LoadXml will fail because only one root
element is
// allowed in XML.
// So if you are sure there is only one immediate child node:
doc.LoadXml(xr.ReadInnerXml());
// Otherwise, wrap the contents within a root node to be sure:
doc.LoadXml(string.Concat("<root>", xr.ReadInnerXml(), "</root>"));

AnotherClass anotherClass = new AnotherClass(doc);
AnotherClass ..ctor :
public AnotherClass ( XmlDocument xmlDocument )
{
....
}
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"juli jul" <ju******@yahoo.com> wrote in message
news:OD****************@TK2MSFTNGP09.phx.gbl...

Hello,
I have a class which reads xml and has to pass to another class(by
making an instance of it and activating it constractor) a part of this
xml that the next class could read it.
I am doing it with ReadInnerXml() but my question is which variable can
contain the result of this function in order to pass it as an xml file
to the following clas?
Thank you very much!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.