Colleagues,
Here's what's happening: I, the Program, read a "truncated" XML file which I need to format and write back N times.
Formatting code:
Then the For-Next cycle to write the whole block these N times - nothing interesting, so I skip it here, and I stop at the moment after the Stream is filled out.
So far, so good: note that, at the break point, the lcBlock in the Locals does have these leading Tabs.
But when I open the output file...
This bloody <CheckDetail> tag is written w/o those leading Tabs!
Hence the question in subject.
OR
Do I do something wrong?
Please advise.
TIA!
Regards,
Ilya
Here's what's happening: I, the Program, read a "truncated" XML file which I need to format and write back N times.
Formatting code:
Code:
' Add 4 Tab chars in front of every line 1st:
lsBlock = lsBlock.Replace(vbCrLf, vbCrLf & Replicate(Chr(9), 4))
' The starting tag <CheckDetail> - move it 1 tab to the right
lsBlock = lsBlock.Replace(Replicate(Chr(9), 4) & "<CheckDetail>", Replicate(Chr(9), 3) & "<CheckDetail>")
' The ending tag </CheckDetail> - move it 1 tab to the left:
lsBlock = lsBlock.Replace(Replicate(Chr(9), 4) & "</CheckDetail>", Replicate(Chr(9), 3) & "</CheckDetail>")
Dim loStreamWriter As New StreamWriter(tcFileOut, True)
'Add compound section's starting tag
loStreamWriter.Write(Replicate(Chr(9), 2) & "<CheckDetails>" & vbCrLf)
So far, so good: note that, at the break point, the lcBlock in the Locals does have these leading Tabs.
But when I open the output file...
This bloody <CheckDetail> tag is written w/o those leading Tabs!
Hence the question in subject.
OR
Do I do something wrong?
Please advise.
TIA!
Regards,
Ilya