|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to read the information from the XML stream?I have the following string:
<photo id="218644972" owner="81716338@N00" secret="e7e02342ba" server="60" title="Phil in Riverside (6)" ispublic="1" isfriend="0" isfamily="0" /> How can I get the id, owner, secret, server and so on to a variable, or a dataTable/dataSet? Thanks in advance, Marko Vuksanovic. string str = "<photo id=\"218644972\" owner=\"81716338@N00\" secret=\"e7e02342ba\" server=\"60\" title=\"Phil in Riverside (6)\" ispublic=\"1\" isfriend=\"0\" isfamily=\"0\" />";
StringReader sreader = new StringReader(str); DataSet ds = new DataSet(); ds.ReadXml(sreader); Mike http://www.seeknsnatch.com "Marko Vuksanovic" <markovuksano***@hotmail.com> wrote in message news:B649571E-53CD-4810-AFEF-A3471B6A1831@microsoft.com... I have the following string:<photo id="218644972" owner="81716338@N00" secret="e7e02342ba" server="60" title="Phil in Riverside (6)" ispublic="1" isfriend="0" isfamily="0" /> How can I get the id, owner, secret, server and so on to a variable, or a dataTable/dataSet? Thanks in advance, Marko Vuksanovic. so what is the problem?
as far as i know, if the data is read from the file there has to be some xml header in the file called DOCTYPE in order not get an error from .Net; the heade should look something like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE rootElement[]> "Marko Vuksanovic" <markovuksano***@hotmail.com> wrote in message news:B649571E-53CD-4810-AFEF-A3471B6A1831@microsoft.com... I have the following string:<photo id="218644972" owner="81716338@N00" secret="e7e02342ba" server="60" title="Phil in Riverside (6)" ispublic="1" isfriend="0" isfamily="0" /> How can I get the id, owner, secret, server and so on to a variable, or a dataTable/dataSet? Thanks in advance, Marko Vuksanovic. Well, the problem is that the text displayed here is a part of a valid xml document. This is only a part of it and I need to get the attributes in a DataTable/DataSet.
"Leon_Amirreza" <amirreza_rahm***@yahoo.com> wrote in message news:e$vOE7wwGHA.1224@TK2MSFTNGP03.phx.gbl... so what is the problem?as far as i know, if the data is read from the file there has to be some xml header in the file called DOCTYPE in order not get an error from .Net; the heade should look something like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE rootElement[]> "Marko Vuksanovic" <markovuksano***@hotmail.com> wrote in message news:B649571E-53CD-4810-AFEF-A3471B6A1831@microsoft.com... I have the following string:<photo id="218644972" owner="81716338@N00" secret="e7e02342ba" server="60" title="Phil in Riverside (6)" ispublic="1" isfriend="0" isfamily="0" /> How can I get the id, owner, secret, server and so on to a variable, or a dataTable/dataSet? Thanks in advance, Marko Vuksanovic. |
|||||||||||||||||||||||