B
bg_ie
Hi,
I'm working in VB6 and I'm processing an xml file which is tabbed as
follows -
<?xml version="1.0"?>
<Barry>
<Meta/>
<Data>
<Block Version="01">
<NODE Name="1" Value="A" Updated="false"/>
<NODE Name="3" Value="B" Updated="false"/>
<NODE Name="8" Value="B" Updated="false"/>
<NODE Name="11" Value="A" Updated="false"/>
I then process this file and I replace the Block Node as follows -
<?xml version="1.0"?>
<Barry>
<Meta/>
<Data>
<Block Version="01">
<NODE Name="1" Value="A" Updated="false"/><NODE Name="3" Value="B"
Updated="false"/><NODE Name="8" Value="B" Updated="false"/><NODE
Name="11" Value="A" Updated="false"/>
As you can see, the NODEs are no longer tabbed as they were
previously...
So the question is, how can I correct this formatting as some of the
file users edit the file in notepad and want it tabbed as before?
This is a quick idea as to how I edit the file currently
Set blockNode = xmlDocument__.selectSingleNode("Barry/Data/Block"
Set nodeList = blockNode.childNodes
Set XmlNode = xmlDocument__.createElement("Block")
Set attrName = xmlDocument__.createAttribute("Name")
attrName.Text = "1"
XmlNode.Attributes.setNamedItem attrName
blockNode.appendChild XmlNode
Thanks for your help,
Barry
I'm working in VB6 and I'm processing an xml file which is tabbed as
follows -
<?xml version="1.0"?>
<Barry>
<Meta/>
<Data>
<Block Version="01">
<NODE Name="1" Value="A" Updated="false"/>
<NODE Name="3" Value="B" Updated="false"/>
<NODE Name="8" Value="B" Updated="false"/>
<NODE Name="11" Value="A" Updated="false"/>
I then process this file and I replace the Block Node as follows -
<?xml version="1.0"?>
<Barry>
<Meta/>
<Data>
<Block Version="01">
<NODE Name="1" Value="A" Updated="false"/><NODE Name="3" Value="B"
Updated="false"/><NODE Name="8" Value="B" Updated="false"/><NODE
Name="11" Value="A" Updated="false"/>
As you can see, the NODEs are no longer tabbed as they were
previously...
So the question is, how can I correct this formatting as some of the
file users edit the file in notepad and want it tabbed as before?
This is a quick idea as to how I edit the file currently
Set blockNode = xmlDocument__.selectSingleNode("Barry/Data/Block"
Set nodeList = blockNode.childNodes
Set XmlNode = xmlDocument__.createElement("Block")
Set attrName = xmlDocument__.createAttribute("Name")
attrName.Text = "1"
XmlNode.Attributes.setNamedItem attrName
blockNode.appendChild XmlNode
Thanks for your help,
Barry