Line Feed XML File

I am using SqlXmlCommandType component to generate an XML file in a VB.net 
Console Application. Everything ran perfect except one thing. I need to know 
if there is anyway to make this XML file Line feed file. In other words, I 
need to put each tag in one line instead of mixing them up.

Do I have to create an XSL file to do this transformation, or there is 
another way on the .net framework to do it?
0
10/4/2005 6:34:08 PM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
529 Views

Similar Articles

[PageSpeed] 20

Nader Shahin wrote:
> I am using SqlXmlCommandType component to generate an XML file in a VB.net 
> Console Application. Everything ran perfect except one thing. I need to know 
> if there is anyway to make this XML file Line feed file. In other words, I 
> need to put each tag in one line instead of mixing them up.

Why do you need this? Every compilant XML parser shouldn't have any 
problems with even all XML in one line.

> 
> Do I have to create an XSL file to do this transformation, or there is 
> another way on the .net framework to do it?

The simplest way I know is inheriting a custom class from XmlTextWriter 
and overwrite the Write.. Methods to add an '\n' to every written token. 
(for example in public override WriteEndElement(){ 
base.WriteEndElement(); ...Write('\n'); })

Maybe indentation can also help you? It is not exactly what you 
described but...

-- 
Pascal Schmitt
0
10/4/2005 8:45:14 PM
I know that Every XML parser doesn't have any problems with this, but it's 
required in my project.

I know that i can do it by XmlTextWriter but i don't need to write one by one.
This is why i used "ExecuteToStream" so i don't need to worry about each 
element.

So I was thinking if i can create an XSL transformer i can solve this 
problem but i am not sure if this is the right way or i can find something in 
the .net can help.

"Pascal Schmitt" wrote:

> Nader Shahin wrote:
> > I am using SqlXmlCommandType component to generate an XML file in a VB.net 
> > Console Application. Everything ran perfect except one thing. I need to know 
> > if there is anyway to make this XML file Line feed file. In other words, I 
> > need to put each tag in one line instead of mixing them up.
> 
> Why do you need this? Every compilant XML parser shouldn't have any 
> problems with even all XML in one line.
> 
> > 
> > Do I have to create an XSL file to do this transformation, or there is 
> > another way on the .net framework to do it?
> 
> The simplest way I know is inheriting a custom class from XmlTextWriter 
> and overwrite the Write.. Methods to add an '\n' to every written token. 
> (for example in public override WriteEndElement(){ 
> base.WriteEndElement(); ...Write('\n'); })
> 
> Maybe indentation can also help you? It is not exactly what you 
> described but...
> 
> -- 
> Pascal Schmitt
> 
0
10/5/2005 1:57:06 PM
Yes, there are ways you can use .Net Methods to format your XML file or use XSl for your specific problem. If you are using an XMLTextWriter to generate the XML just set the Formatting property of the writer to Formatting.Indented

MyXmlTextWriter.Formatting = Formatting.Indented;

you can also set the number of characters per indentation by setting the indentation property to an int value corresponding to the number of characters. I think this will take care of your needs. We can discuss more on several other possibilities if you have any other specific queries on this.



**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
0
gsaby2002 (1)
10/13/2005 11:20:17 PM
Reply:

Similar Artilces:

#Delete Mark in Bound Memo filed
I have form that has bound memo field, sometime, no sure how it happen, the memo filed is filled with #Delete. My application is a stand alone program. Kindly advise what can cause this and how to avoid it from happening. -- TS Lim When was the last time you performed a compact and repair? Is you db split? Does each user have their own copy of the front-end? Please checkout http://www.granite.ab.ca/access/corruptmdbs.htm http://www.granite.ab.ca/access/corruption/symptoms.htm http://office.microsoft.com/en-ca/access/HA011865661033.aspx - No very helpful but directly from MS ...

Dynamic Xml editor
Hi, I am writing a user control that will help a user that know (almost) nothing about Xml to build a Xml file based on a Xsd schema that is given to the user control. The idea is to have a treeview on the left and a property grid on the right. The treeview is loaded with the root elements from the schema. When the user right click on a node, a context menu allow him to add subnodes if schema allow it. This way, the user can create items, attributes, ... The property grid is filled by the user with data. At the end, the Xml file is generated and validated. My problem is about the design....

CSV File Problem
Can any one explain why the following problem occurs please? A colleague has a small list of data which is a csv file exported from SQL. Column One is a serial number from 1 to 29. Column 2 is a number of transactions which have occurred.(it should look like example A below in Excel) 1 475 1,475 2 1732 21,732 3 1670 31,670 4 2176 42,176 5 608 5,608 6 1579 61,579 7 43101 743,101 8 54512 854,512 9 51258 951,258 10 61050 1,061,050 A B If I double click on the csv file, it opens in Excel but c...

CFile (delete file)
How can I delete all files that end with ".temp" in some folder? CFile::Remove remove unlink -- cheers, Alok Gupta Blogs: http://wdevs.com/thatsalok "Petar Popara" <my.fake@mail.net> wrote in message news:Op6#URKfFHA.2644@TK2MSFTNGP09.phx.gbl... > > How can I delete all files that end with ".temp" in some folder? > > SHFileOperation() will and it supports wildcards! DeleteFile() will operate on one file at a time. "Petar Popara" <my.fake@mail.net> wrote in message news:Op6%23URKfFHA.2644@TK2MSFTNGP09.phx.gbl... > >...

Opening an *.MSG file with it's respective attachment.
Hello, The file *.MSG is a message file. This can be viewed by any editor, like Notepad. However, when there's an attachment to it, we see garbage. Is there a way to open the attachments present inside the *.MSG files ? Thank you Yes, by opening it with Outlook. -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tips of the month: -Create your own fully customized Toolbar -Creating a Classic View in Outlook 2003 Subscribe to the newsletter to receive news and tips & tricks in your mailbox!...

Can't open 2005 data file after reinstalling Money 2005
I am experiencing a recurring problem. I have had to reinstall Windows XP and MS Money 2005. I am now unable to open my previously converted 2005 file or restore any backup version. I consistently get the following error message: "Money cannot locate filename or cannot open it, possibly because it is a read-only file, you do not have permission to change it, or your disk drive is write- protected. If you have chosen the correct file and it cannot be accessed, you will need to click OK and then Restore your most recent backup file." Any help or thoughts would be greatly ap...

import a 123 file
My excel version cannot open a Lotus 123 file. Is there an import feature to move the data from Lotus 123 to Excel? Thanks No, you need to convert the file either from Lotus 123 or get commercial converter -- Regards, Peo Sjoblom "Frank" <Frank@discussions.microsoft.com> wrote in message news:59B55F98-4C79-4917-928B-F1B309660730@microsoft.com... > My excel version cannot open a Lotus 123 file. Is there an import feature > to > move the data from Lotus 123 to Excel? > Thanks > > ...

Where is the cache files folder located for windows media player?
Does windows media player have a cache files folder? Where is the cache files folder located for windows media player? Or how do I find the cache files folder for windows media player? Thank You for your Help. Bob Background info: I have a desktop AMD 4400+ 64X2 4GB memory 320GB HD(way bigger than I need) Acer computer (AM3100-U3201A) I purchased new February 2008 running 32-bit MS Vista Home Premium SP2 box. I use MS auto updates. I think it has onboard shared memory for video and sound. My ISP is Comcast 12mbps with Motorola SURFboard SB5101 Cable Modem direct to...

SpreadSheetML (XML for Excel)
Hello All, A client of mine has Office X for Mac. I am wondering if this edition of Excel supports SpreadSheetML. I have heard that it also support the new Open XML formats (same as Office 11). Does anyone know if either of these statements is accurate? Thanks in advance, -KJ Hi KJ: I believe that both statements are wrong. The XML converter for Office Next on the Mac has not yet been developed. It's not likely to come until after the PC Office team ships their product to retail -- until they stop CHANGING the thing :-) My guess is that the converter won't appear until sometime...

Public Folder link to Excel File
Hi - I have a user that claims that he had a shortcut to a spreadsheet "in his public folders" at his old job. Obviously, he's an end user that may or may not know what he's talking about.... I'm trying to figure out the best way to accomodate him. He basically wants an Excel file stored on a shared folder to be available to all user as either a shortcut, or a link in the public folders (can't post to a folder as he will be updating the sheet regularly). When a user clicks on the shortcut/link, it would just launch Excel and display the file. Anybody have any ideas...

shortcut with command line switch probs
Hello, I have a shortcut set up which has the target declared as: "C:\Program Files\Microsoft Office\Office\EXCEL.EXE" / "\\path_to_file\myfile.xlt" This works fine on my PC. Excel 2000 running on Windows XP. Unfortunately it doesnt work on someone elses PC, who asked for m help! They have the same software set up, and access to the same folde path. When they try to run the shortcut, a window opens and closes almos immediately. Help?! : -- soloto ----------------------------------------------------------------------- solotoo's Profile: http://www.excelforum.com/m...

Opening pub files created with older Publisher versions #2
I have just upgraded to Publisher 2003 from 2000 and am having trouble with pub files sent to me for our chuch newsletter which is using Publisher 97 The text is not wrapping around graphics boxes. Can I fix this? I really don't want to go back to Pub 200 Thank Richard this is caused by Publisher 97 not been printer independent. Even if you went back to Publisher 2000, unless you have the identical font versions and printer driver you would have issues with formatting. It sounds like the person sending you the file has a garbage HP inkjet printer. Get them to install the HP5P laser p...

Renaming Partial File Names
Is it possible to rename part of a file name? (almost like a find and replace) My database pulls in the excel file names from a directory, with it's subfolders and contents as well. Every file begins with "Kay Form". Kay no longer works in our department, and I'd like to run a loop that replaces "Kay Form" with "Featured Track". I don't know how to do a partial replace though. Thank you in advance! -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/201001/1 Checkout the Replace function. I...

printing imported gif files in Excel
When printing gif file with transparent background on the grey(25%) background of Excel non-transparent part of the picture has white border around it. Is there any way to prevent it? Thank you in advance... Tim ...

unknown .edb file
I have error messages in the log files that references a corrupt database named C:\Program Files\exchsrvr\Exchangeserver_Outlook.edb. "Outlook" is the name of the server. The problem is that this database is not listed in any of the Mail Stores or Public stores. I want to run the repair utilities on it, but since I'm not sure what it is used for, I don't know how I can restore it if the repair goes bad. Does anyone know what this is used for or how I can determine that myself? BTW, the database always has a current time stamp, so I assume that it is used by something....

Copying dbx files from a CDR back into Outlook
My computer was recently hijakced and I had to reinstall everything. I did however save all of my folders in Outlook onto a CD Rom and I do not know how to transfer them back so I can use them. Also I had an animated version of outlook where you could choose loads of diffent stationery and I cannot seem to find that upgrade anaywhere. Can you help me? Tee <tsahai33@hotmail.com> wrote: > My computer was recently hijakced and I had to reinstall > everything. I did however save all of my folders in > Outlook onto a CD Rom and I do not know how to transfer > them back so...

DB_Backup.MDB file has appeared beside DB.MDB.
I have a local DB.MDB which accesses a DATA.MDB on a network drive. I use a user-level security file. It has been working AOK for a year or so. Yesterday one of the users reported an error dialog when attempting to open the DB.MDB (unfortunately the wording of the dialog was not captured!) After this 'event', the database started working correctly once again. The result was a DB_Backup.MDB file appeared beside the DB.MDB. Any ideas? That backup file is created when ACCESS "crashes" during use..... -- Ken Snell <MS ACCESS MVP> "Andrew (UGL)&quo...

Create Exchange mailbox from command line
I'm writing a script using dsadd and I was wondering if it's possible to create an exchange mailbox from the command line. Donovan Maybe not exactly what you want but it may help: http://www.joeware.net/win/free/tools/exchmbx.htm -- Neil Hobson Exchange MVP For Exchange news, links, and tips, check: http://www.msexchangeblog.com "Donovan Linton" <DonovanLinton@discussions.microsoft.com> wrote in message news:D9C839EF-883D-4E2E-8BE9-57782582F043@microsoft.com... > I'm writing a script using dsadd and I was wondering if it's possible to > create an ...

Archiving Outlook.pst files to Novell Netware file server
Hi all We are trying to perform a manual Outlook inbox archive which we are tryingto save to a Novell file server - but it dowsn't work. Any ideas why? (works fine on the MS2000 server but we don't have the space for everyone) We are currently running Outlook 2003 and the Novell file server is 4.8.3 Any help would be appreciated Thanks!! kwan <kevin.kelly@levittbernstein.co.uk> wrote: > We are trying to perform a manual Outlook inbox archive which we are > tryingto save to a Novell file server - but it dowsn't work. Any ideas > why? (works fine on the MS2000 s...

Sorting by file extension in a worksheet
Hello, I have an excel worksheet which has a list of file names from a directory and various stats about each file. I need to be able to sort them by the file extension. Eg. c:\documents\folderA\picture1.eps c:\documents\folderB\document.doc I would like to sort them by the ".eps" extension. I have tried using the Data,Sort menu and something like *?*.eps as the criteria. But am obvisouly missing something. Any help would be most appreciated. Thanks Karl You could use a helper column to extract just the extension then include this in your sort range and sort on the helper col...

Get Xml from web .
This is a link to an address where I would like to access xml. http://setiathome2.ssl.berkeley.edu/fcgi-bin/fcgi?cmd=user_xml&email=XXXX The XXXX is the email address of a user. All I want to do is access the xml and view it in a datagrid. I have read several tuturials and articles and have not been able to find something that would explain how to do this. Does anyone know of a sample code or something close I could use as a reference. I am using visualstudio.net. and visual basic. THX Take a look at using the following classes on your app: HttpWebRequest HttpWebResponse DataSe...

Outlook 2007 PST files and temp files
When I have PST files on the server, I notice that there is a temp file accompanying it when Outlook is loaded. Would loading the temp file on the local PC make Outlook quicker, if so, how can one do this...? Thanks, Tom... "TK" <tkarpowski@bennettcompany.com> wrote in message news:Ovq2RUgvJHA.1088@TK2MSFTNGP04.phx.gbl... > When I have PST files on the server, I notice that there is a temp file > accompanying it when Outlook is loaded. > > Would loading the temp file on the local PC make Outlook quicker, if so, how > can one do this...? You shouldn...

crop files
I've a file with this structure Code value 0001 dfdf 0002 ddgdfg 0001 dsdfsd 0001dfdgdsgds 0002 defert I'd like to crop this file in 2 different files ..one for 0001 and the other for 0002 with of course Code value for both and then block a cell in both. the name of the file and the name of the sheet should be given with a textbox input and they will be the same for both.. the directory will be the same of the main file. any hints?? or a guide I should follow since I'd like to learn and do everything by myself??? thanks Rossella Try Data>Filter>Advanced Filter HTH -- AP ...

Loading Text File to TextBox using LoadFromFile
Hi All, I'm creating a form that allows the user to pick a txt file (dialog) and then display the path and contents on the form. The code has been cobbled together as I found the pieces that worked, so bear with. I got the file picker working and displaying the file name on the form, but the file contents won't display. I had a feeling the problem had to do with importing a namespace (see the error in the code when I tried "Imports System.IO") or with a missing reference. Using Access 2003. References: VB for Apps, MS Access 11 Obj Lib, OLE Auto, MS V...

difference between 2 lines in a scatter chart
I have created a scatter chart with two lines. The x axis is divided up into 10 parts and labeled 10, 20, 30, 40, etc. What I want to do is calculate the distance between the two lines between the x values of 40 and 60. Does anyone know how to to that? Thank you in advance. -- prd02003 ------------------------------------------------------------------------ prd02003's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25762 View this thread: http://www.excelforum.com/showthread.php?threadid=391727 How did you generate the lines? Are they from the data directly...