Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2006, 12:59 AM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default writing into xml file

Hi
  I am working in c#.net. I have a text file with few lines of data.
Eg:-
MSH|^~\$|ADMIT|CLAY COUNTY MEMORIAL||
EVN|A01|200502110909||

| is the delimiter. I want to parse the values within the delimiter into the xml file to its corresponding tags. I want to dynamically get the name of the tags (say using loops) and assign the values from the text file to it. I have already used methods like xml.WriteStartElement and also used dataset. Since this is similar to hard coding ,I want you to suggest a different method.

Thank you.



 
Old August 18th, 2006, 02:40 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It's very easy to tackle this problem in XSLT 2.0, but I don't know if that's an option for you. It's probably a lot less code than doing it in C#.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing XML file Using XmlTextWriter class tmadhavi XML 1 December 19th, 2007 09:20 AM
writing to am xml file MOU Classic ASP XML 0 July 6th, 2005 07:38 AM
Reading from a xml file and writing to another billy_bob_the_3rd XML 5 April 29th, 2005 01:40 PM
Writing XML file within Loop (c#) rathbird General .NET 0 December 13th, 2004 05:26 PM
over writing an xml file using asp jojys XML 2 September 14th, 2004 08:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.