Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML File Formatting

Status
Not open for further replies.

cmhunt

Programmer
Apr 17, 2001
119
GB
Hi

I'm currently delivering a series of XML files to clients. Files are all well formed and abide by schema. Clients, however, would like the file formatted for readability. I've told them that they can open the file in IE which'll make it readable but that want line feeds and tabs actually applied within the files. Current situation is that there are no line feeds or tab characters within the file and on viewing in notepad, all information is on one line (as you'd expect really!). Please could someone give me a hand where to start in order to format these files? Would I read in node by node and do the formatting manually or is there a more efficient way of doing this?

Thanks for your help.

Chris
 
You could read the contents of the file into a string and simply replace < or > characters to include a cariiage return before or after them. You would then just use the string to recreate the file.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
cmhunt -
Please don't cross-post -- You also posted this in the VB.NET forum.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top