|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
parsing an xml string into fieldsI'm getting a small xml file as on big string and need to parse it into
it's fields for use. Can anyone point me to a nifty way to do this in .net? cj wrote:
> I'm getting a small xml file as on big string and need to parse it into Take a look at the xmldocument class. There is a method there that load > it's fields for use. Can anyone point me to a nifty way to do this in > .net? from a string. Chris > I'm getting a small xml file as on big string and need to parse it into dim oDom as new XMLDocument> it's fields for use. Can anyone point me to a nifty way to do this in .net? oDom.LoadXML(sXml) ....is that what you were looking for? Matt
http://www.kjmsolutions.com/xmlsettings.htm
--
Show quote
Hide quote
Get a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "cj" <cj@nospam.nospam> wrote in message
news:%23psCfxVQGHA.2496@TK2MSFTNGP11.phx.gbl... > I'm getting a small xml file as on big string and need to parse it into > it's fields for use. Can anyone point me to a nifty way to do this in > .net? Hi,
Thanks for posting! From your description, my understanding is that you want to read a XML format string and obtain some values in it. If I have misunderstood anything, please let me know. As Matt mentioned, the XmlDocument.LoadXml method is appropriated for the current issue. The following article from MSDN demonstrates how to approach this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/ frlrfsystemxmlxmldocumentclassloadxmltopic.asp Thanks for your understanding! Regards, Yuan Ren [MSFT] Microsoft Online Support ====================================================== PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were updated on February 14, 2006. Please complete a re-registration process by entering the secure code mmpng06 when prompted. Once you have entered the secure code mmpng06, you will be able to update your profile and access the partner newsgroups. ====================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from this issue. ====================================================== This posting is provided "AS IS" with no warranties, and confers no rights. ====================================================== What do you think of this method?
http://www.fawcette.com/vsm/2002_10/online/hottips/esposito2/ Yuan Ren[MSFT] wrote: Show quoteHide quote > Hi, > > Thanks for posting! > > From your description, my understanding is that you want to read a XML > format string and obtain some values in it. If I have misunderstood > anything, please let me know. > > As Matt mentioned, the XmlDocument.LoadXml method is appropriated for the > current issue. The following article from MSDN demonstrates how to approach > this: > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/ > frlrfsystemxmlxmldocumentclassloadxmltopic.asp > > Thanks for your understanding! > > Regards, > > Yuan Ren [MSFT] > Microsoft Online Support > ====================================================== > PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were > updated on February 14, 2006. Please complete a re-registration process > by entering the secure code mmpng06 when prompted. Once you have > entered the secure code mmpng06, you will be able to update your profile > and access the partner newsgroups. > ====================================================== > When responding to posts, please "Reply to Group" via your newsreader > so that others may learn and benefit from this issue. > ====================================================== > This posting is provided "AS IS" with no warranties, and confers no rights. > ====================================================== > Hi,
Thanks for your reply! Using the XmlReader class is also appropriated. Just for your reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm l/cpconreadingxmlwithxmlreader.asp Regards, Yuan Ren [MSFT] Microsoft Online Support ====================================================== PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were updated on February 14, 2006. Please complete a re-registration process by entering the secure code mmpng06 when prompted. Once you have entered the secure code mmpng06, you will be able to update your profile and access the partner newsgroups. ====================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from this issue. ====================================================== This posting is provided "AS IS" with no warranties, and confers no rights. ====================================================== I went with Matt's and your way after all. I couldn't figure out how to
retrieve the values from the XmlTextReader. Here's what I have now: Dim doc As New XmlDocument doc.LoadXml(xmlReply) Dim actNbr As XmlNodeList = doc.GetElementsByTagName("account_number") Dim replyCode As XmlNodeList = doc.GetElementsByTagName("reply_code") MessageBox.Show("Account: " & actNbr(0).InnerText) MessageBox.Show("Reply code: " & replyCode(0).InnerText) This works fine but I want to learn and am always open to suggestions if anyone has any. Yuan Ren[MSFT] wrote: Show quoteHide quote > Hi, > > Thanks for your reply! > > Using the XmlReader class is also appropriated. Just for your reference: > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm > l/cpconreadingxmlwithxmlreader.asp > > Regards, > > Yuan Ren [MSFT] > Microsoft Online Support > ====================================================== > PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were > updated on February 14, 2006. Please complete a re-registration process > by entering the secure code mmpng06 when prompted. Once you have > entered the secure code mmpng06, you will be able to update your profile > and access the partner newsgroups. > ====================================================== > When responding to posts, please "Reply to Group" via your newsreader > so that others may learn and benefit from this issue. > ====================================================== > This posting is provided "AS IS" with no warranties, and confers no rights. > ====================================================== > Hi,
Thanks for your reply! If you want to use the XmlTextReader class, the following article demonstrates how to do this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm l/cpconReadingXMLWithXmlReader.asp Actually, the ReadInnerXml method is appropriated. Hope this will be useful! Regards, Yuan Ren [MSFT] Microsoft Online Support
VSTO 2005 - Read Range from excel
Create application to extract data from excel sheet OOP / 3-Tier development questions VB.NET 2005 & XML writing custom event for minimise, restore and close buttons How to create a Service to Log Application Names Convert Script code to VB.Net Re: "Visual Web Developer does not support creating Web sites on a Simple question: How to find Elapsed time (in seconds) formatting time and date |
|||||||||||||||||||||||