|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
xml file formatI 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 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 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 > > > martin1 wrote:
Show quoteHide quote > I create xml file ... the file looks like below Why?> > <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> 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. Hello Martin,
> I create xml file, when open in notepad (or any text editor), the file </Data3>> looks like below > > <Root> <Table1> <Data1> 10 </Data1> <Data2> 20 </Data2> <Data3> 40 Show quoteHide quote > <Table1> </Root> I don't know why you want separate line, but this job could do a simple> > 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? 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 |
|||||||||||||||||||||||