Home All Groups Group Topic Archive Search About
Author
16 Nov 2006 10:42 PM
martin1
Hi, All,

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

<Root> <Table1> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40 </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>
<Data1> 10 </Data1>
<Data2> 20 </Data2>
<Data3> 40 </Data3>
<Table1>
</Root>

Can anyone help this out?

Thank you for your time
Martin

Author
16 Nov 2006 11:22 PM
Tim Patrick
Was that a typo in the closing <Table1> tag? 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

Show quoteHide quote
> Hi, All,
>
> I create xml file,  when open in notepad (or any text editor), the
> file looks like below
>
> <Root> <Table1> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40
> </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> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40
> </Data3> <Table1> </Root>
>
> Can anyone help this out?
>
> Thank you for your time
> Martin
Author
17 Nov 2006 2:33 PM
martin1
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

Show quoteHide quote
"Tim Patrick" wrote:

> Was that a typo in the closing <Table1> tag? 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> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40
> > </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> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40
> > </Data3> <Table1> </Root>
> >
> > Can anyone help this out?
> >
> > Thank you for your time
> > Martin
>
>
>
Author
17 Nov 2006 12:38 PM
Phill W.
martin1 wrote:

Show quoteHide quote
> I create xml file ... the file looks like below
>
> <Root> <Table1> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40 </Data3>
> <Table1> </Root>
>
> I want the file look like below
>
> <Root>
> <Table1>
> <Data1> 10 </Data1>
> <Data2> 20 </Data2>
> <Data3> 40 </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.
Author
19 Nov 2006 6:52 PM
Holger Boskugel
Hello Martin,

> I create xml file,  when open in notepad (or any text editor), the file
> looks like below
>
> <Root> <Table1> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40
</Data3>
Show quoteHide quote
> <Table1> </Root>
>
> That means it doesn't show each open and close tag one line. I want the
file
> look like below
>
> <Root>
> <Table1>
> <Data1> 10 </Data1>
> <Data2> 20 </Data2>
> <Data3> 40 </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