http://msdn.microsoft.com/en-us/library/ms256086.aspx
http://msdn.microsoft.com/en-us/library/ms256115.aspx http://www.codinghorror.com/xpath/4.0/ ∞ Andy Badera ∞ +1 518-641-1280 ∞ This email is: [ ] bloggable [x] ask first [ ] private ∞ Google me: http://www.google.com/search?q=andrew%20badera On Fri, Sep 25, 2009 at 10:47 AM, Pat 2345 <[email protected]> wrote: > > Heres my current code. How would I get the text of the element PNREF? > I want this value "AAA23459" > > this line of code returns nothing to me. Whats wrong with it. > s = doc.SelectSingleNode("/http://www.Fin.com/ay/XMLResponse/ > ResponseData/TransactionResults/TransactionResult/PNRef").InnerText > > > > > xmldata = "<XMLResponse xmlns=""http://www.Fin23.com/ > ay""><ResponseData><Vendor>FIN</Vendor><Partner>FINl</ > Partner><TransactionResults><TransactionResult><Result>54</ > Result><IAVSResult>N</IAVSResult><AVSResult><StreetMatch>Match</ > StreetMatch><ZipMatch>Match</ZipMatch></AVSResult><Message>Approved</ > Message><PNRef>AAA23459</PNRef><AuthCode>2342</AuthCode></ > TransactionResult></TransactionResults></ResponseData></XMLResponse>" > > Dim s As String > 'Load the XML so that we can parse it > doc.LoadXml(xmldata) > > > > Root = doc.DocumentElement > 'I tried adding this but it didnt help > ''Dim finMgr As New XmlNamespaceManager(doc.NameTable) > ''finMgr.AddNamespace("fin", "http://www.Fin23.com/ay") > > > s = doc.SelectSingleNode("/http://www.Fin23.com/ay/ > XMLResponse/ResponseData/TransactionResults/TransactionResult/ > PNRef").InnerText > >
