Results 1 to 4 of 4

Thread: doc.loadxml(axwebbrowser1.document.body.outerhtml), doesn't work?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    8

    doc.loadxml(axwebbrowser1.document.body.outerhtml), doesn't work?

    I am automating the navigation of a website.
    When I reach the end, it changes to xml.

    So my axwebbrowser1 has a bunch of xml data in it.

    So here is what I am trying to do

    Dim xmlText As String
    Dim doc As New XmlDocument()
    Dim myElem As XmlElement
    xmlText = AxWebBrowser1.Document.Body.OuterHTML
    doc.LoadXml(xmlText)

    But the problem is I get an exception error at the doc.loadxml(xmltext)
    I found a streamreader example but I already have the xml data in the axwebbrowser control.
    How do I get it so I can parse through the nodes?

    Thanks for any information

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    are u sure that the innerhtml isnt html but is xml? doesnt look so :S
    \m/\m/

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    8
    The data displayed in the axbrowser window is most definitely xml.

    When I use IE6 to view the web page and then select "View Source" I see this.

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ShipmentForecasts><ShipmentForecast><extract-datetime code="CST">2003-10-13T13:52:06.000-06:00</extract-datetime><FileKey>XYZ...........


    But when I view the xmlText (using innerhtml) string it shows the following:
    <DIV class=3><Span class=b>&nbsp;</SPAN><SPAN class=m>&lt;?</SPAN><SPAN class=pi>xml version="1.0" encoding="ISO-8859-1" </SPAN><SPAN class=m>?&gt;</SPAN> etc etc

    The only difference I see between using innerhtml and outerhtml is the outer contains the <body> tags.

    I need to be able to pull the xml data from the nodes .

    thanks for any advice

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    im not much into the subject but the thing is that XML has some kind of thing (i dont know if it's css or whatever it is) that will format it to proper HTML so the final thing will be HTML
    the only way i see you could do it would be download the XML itself and not loading the page in the webbrowser control
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width