|
-
Feb 19th, 2005, 12:52 AM
#1
Thread Starter
Hyperactive Member
display contents of an xml file
anyone know how I can display an xml doc after updating. within a vb app
cheers
R
-
Feb 19th, 2005, 12:55 AM
#2
Re: display contents of an xml file
IE will open ab XML document.
-
Feb 19th, 2005, 12:59 AM
#3
Thread Starter
Hyperactive Member
Re: display contents of an xml file
could I use something like for example the webbrowser so its within my main app. e.g when the user clicks a cmd button it loads the xml into it?
cheers
R
-
Feb 19th, 2005, 01:23 AM
#4
Re: display contents of an xml file
I've never tried it. Let me know if it works.
-
Feb 19th, 2005, 01:51 AM
#5
Thread Starter
Hyperactive Member
Re: display contents of an xml file
I managed to do it the easy way lol and just load it in a text box using this code
VB Code:
Private Sub cmdLoadXML_Click()
Dim xmlDoc As New DOMDocument
Dim xmlRootElement As IXMLDOMElement
Dim xmlError As IXMLDOMParseError
Dim success As Boolean
xmlDoc.async = False
xmlDoc.validateOnParse = True
success = xmlDoc.Load("c:/mgamerz/audiolist.xml")
If success = True Then
Set xmlRootElement = xmlDoc.documentElement
txtXML.Text = xmlRootElement.xml
Set xmlRootElement = Nothing
Else
Set xmlError = xmlDoc.parseError
txtXML.Text = "Error code: " & xmlError.errorCode & vbCrLf _
& "Reason: " & xmlError.reason & vbCrLf _
& "Source: " & vbCrLf & xmlError.srcText & vbCrLf _
& "URL: " & xmlError.url
Set xmlError = Nothing
End If
End Sub
-
Feb 19th, 2005, 02:00 AM
#6
Re: display contents of an xml file
IE formats it nicely. That's why I wondered if the web browser control did.
Glad you got it working.
-
Feb 19th, 2005, 02:09 AM
#7
Thread Starter
Hyperactive Member
Re: display contents of an xml file
yeah it isnt to well formatted as it is is it done in a similar way using IE? I wanted it to be in a box within the app can this be done with IE and how hard is it?
Thanks
R
-
Feb 19th, 2005, 02:11 AM
#8
Re: display contents of an xml file
You just put the control on a form, and that's it. I don't have any code handy. I use the web browser, or Inet control.
-
Feb 19th, 2005, 02:13 AM
#9
Thread Starter
Hyperactive Member
Re: display contents of an xml file
is that a reference or component?
-
Feb 19th, 2005, 02:19 AM
#10
Thread Starter
Hyperactive Member
Re: display contents of an xml file
Also would I be able to use the same code but replace the textbox with the webbrowser1?
thanks
Rob
-
Feb 19th, 2005, 02:52 AM
#11
Re: display contents of an xml file
I can't find any code to open it in a form. not sure that it wasn't a web browser
that's why you should try it to see if it IS the same as IE. open the file with
file:\\myxml.xml instead of http:\\
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|