By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,239 Members | 1,503 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,239 IT Pros & Developers. It's quick & easy.

xml file format

P: n/a
Hi, All,

I create xml file, when open in notepad (or any text editor), the file
looks like below

<Root<Table1<Data110 </Data1<Data220 </Data2<Data340 </Data3>
<Table1</Root>

That means it doesn't show each open and close tag one line. I want the file
look like below

<Root>
<Table1>
<Data110 </Data1>
<Data220 </Data2>
<Data340 </Data3>
<Table1>
</Root>

Can anyone help this out?

Thank you for your time
Martin

Nov 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Was that a typo in the closing <Table1tag? You forgot the "/" character.
Also, you need to add in the xml header as the first line.

<?xml version="1.0"?>

-----
Tim Patrick - www.timaki.com
Start-to-Finish Visual Basic 2005
Hi, All,

I create xml file, when open in notepad (or any text editor), the
file looks like below

<Root<Table1<Data110 </Data1<Data220 </Data2<Data340
</Data3<Table1</Root>

That means it doesn't show each open and close tag one line. I want
the file look like below

<Root<Table1<Data110 </Data1<Data220 </Data2<Data340
</Data3<Table1</Root>

Can anyone help this out?

Thank you for your time
Martin

Nov 16 '06 #2

P: n/a
martin1 wrote:
I create xml file ... the file looks like below

<Root<Table1<Data110 </Data1<Data220 </Data2<Data340 </Data3>
<Table1</Root>

I want the file look like below

<Root>
<Table1>
<Data110 </Data1>
<Data220 </Data2>
<Data340 </Data3>
<Table1>
</Root>
Why?

The former is (syntactic errors notwithstanding) perfectly good XML and
any XML reader will happily crunch its way through it.
The presence or absence of whitespace is irrelevant.

There /may/ be some sort of "whitespace" property on the XML object that
will put the line-breaks in, but they /really/ don't matter.

Regards,
Phill W.
Nov 17 '06 #3

P: n/a
you are right, the close tag is </Table1>. But when add the header in he
first line, still no line-break, any more advice?

Thaks,
Martin

"Tim Patrick" wrote:
Was that a typo in the closing <Table1tag? You forgot the "/" character.
Also, you need to add in the xml header as the first line.

<?xml version="1.0"?>

-----
Tim Patrick - www.timaki.com
Start-to-Finish Visual Basic 2005
Hi, All,

I create xml file, when open in notepad (or any text editor), the
file looks like below

<Root<Table1<Data110 </Data1<Data220 </Data2<Data340
</Data3<Table1</Root>

That means it doesn't show each open and close tag one line. I want
the file look like below

<Root<Table1<Data110 </Data1<Data220 </Data2<Data340
</Data3<Table1</Root>

Can anyone help this out?

Thank you for your time
Martin


Nov 17 '06 #4

P: n/a
Hello Martin,
I create xml file, when open in notepad (or any text editor), the file
looks like below

<Root<Table1<Data110 </Data1<Data220 </Data2<Data340
</Data3>
<Table1</Root>

That means it doesn't show each open and close tag one line. I want the
file
look like below

<Root>
<Table1>
<Data110 </Data1>
<Data220 </Data2>
<Data340 </Data3>
<Table1>
</Root>

Can anyone help this out?
I don't know why you want separate line, but this job could do a simple
replace
if you have a fixed structure, in the sample above you could do this steps :

a) Replace "<Table" with "{CrLf}<Table"
b) Replace "<Data" with "{CrLf}<Data"
c) Replace "</Table" with "{CrLf}</Table"
d) Replace "</Root" with "{CrLf}</Root"
Regards

Holger
Nov 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.