Is there a way to format a XML file and make it go into block mode.
When I save a XML file, the content is in one line. It works but just hard to read.
Printable View
Is there a way to format a XML file and make it go into block mode.
When I save a XML file, the content is in one line. It works but just hard to read.
Yes, you can use Microsoft XML x.x library - go to Project -> References and select one from the list ... But how did you do it ?
Thanks but I know that already. I actually need to make it look read able when it is saved in XML.
open it in internet explorer.
Fine, "... But how did you do it ?" - show us.Quote:
Originally Posted by Liquid Metal
dglienna, that is what I want but need the actual content of the file like that.Code:Dim objDom As DOMDocument
Dim objRootElem As IXMLDOMElement
Set objRootElem = objDom.createElement("Root")
objDom.appendChild objRootElem
Set objMemberElem = objDom.createElement("Member")
objRootElem.appendChild objMemberElem
Call objDom.save(App.Path & "\Output.xml")
I have this to read the file...
VB Code:
Option Explicit Private Sub Form_Load() GetHTML MsgBox GetHTML End Sub Private Function GetHTML() As String Dim html As IXMLHTTPRequest Set html = CreateObject("Microsoft.XMLHTTP") With html .Open "GET", "http://www.vbforums.com/", False .send GetHTML = .responseText End With Set html = Nothing End Function
I don't get it. Here is an xml file that I have that is the output of a component checker. It is readable in Notepad, as I have here, as well as showing up color coded in IE.
Quote:
<cc>
<releases>
<release name="MDAC 2.1 SP2"/>
<release name="MDAC 2.5"/>
<release name="MDAC 2.5 SP1"/>
<release name="MDAC 2.5 SP2"/>
<release name="MDAC 2.5 SP3" />
<release name="MDAC 2.6 RTM" />
<release name="MDAC 2.6 SP1" />
<release name="MDAC 2.6 SP2" />
<release name="MDAC 2.6 SP2 Refresh" />
<release name="MDAC 2.7 RTM" />
<release name="MDAC 2.7 Refresh" />
<release name="MDAC 2.7 SP1" />
<release name="MDAC 2.7 SP1 Refresh" />
<release name="MDAC 2.8 RTM" />
<release name="MDAC 2.7 SP1 on Windows XP SP1" />
</releases>
</cc>
This is exactly what I want but can it goes against a XML file? It pretty the XML or put it in well-formed. I tried it against a file but it failed at the send command.Quote:
Originally Posted by dglienna
You know, I found a way to do this but it has to be done in .Net. Still want to know if it is possible to do it in VB6?