Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 21st, 2008, 05:07 AM
Authorized User
 
Join Date: May 2008
Location: Pune, Maharashtra, India.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prafullaborade
Default convert string to xml

 public static string xmlServiceType()
            {
                string path;
                path = Convert.ToString(HttpContext.Current.Server.MapPat h("~/App_Data/xml1.xml"));
                return path;
            }
           // convert string into xml
            public static string getReportBackUp(string MailID)
            {

                XmlDocument doc = new XmlDocument();
                doc.Load(xmlServiceType());
                XmlElement newElem = doc.CreateElement("Mail");
                XmlAttribute MailTo = doc.CreateAttribute("MailTo");
                MailTo.Value = MailID;

                newElem.Attributes.Append(MailTo);
                // doc.DocumentElement.AppendChild(newElem);
                doc.DocumentElement.AppendChild(newElem);
                string s = Convert.ToString(MailID);

                doc.Save(xmlServiceType());
                //string s = newElem.ToString();
                return s;

            }

i convert string coming from text box to xml and also wrie it uin xml & database
but if i fired more than 1 email id from textbox in xml file it comes to 1 line
but i want 1 email id at 1 line and 2 at 2 line even if it is fired at atime i want code for that

Reply With Quote
  #2 (permalink)  
Old May 21st, 2008, 05:27 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please say what technology you are using - you can't expect people to read your code to discover whether it's Java or C#, Oracle or Microsoft.

And please phrase your question in English. We aren't all teenagers versed in text shorthand:

i want 1 email id at 1 line and 2 at 2 line even if it is fired at atime i

Oh, and please say "please".



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old May 21st, 2008, 06:40 AM
Authorized User
 
Join Date: May 2008
Location: Pune, Maharashtra, India.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prafullaborade
Default

 public static string xmlServiceType()
            {
                string path;
                path = Convert.ToString(HttpContext.Current.Server.MapPat h("~/App_Data/xml1.xml"));
                return path;
            }
           // convert string into xml
            public static string getReportBackUp(string MailID)
            {

                XmlDocument doc = new XmlDocument();
                doc.Load(xmlServiceType());
                XmlElement newElem = doc.CreateElement("Mail");
                XmlAttribute MailTo = doc.CreateAttribute("MailTo");
                MailTo.Value = MailID;

                newElem.Attributes.Append(MailTo);
                // doc.DocumentElement.AppendChild(newElem);

                doc.DocumentElement.AppendChild(newElem);
                string s = Convert.ToString(MailID);

                doc.Save(xmlServiceType());
                //string s = newElem.ToString();
                return s;

            }
 This code is in c# which convert String to XML & write it in xml file & database.
I am fired string from TextBox. But in XML file multiple Email ID come at single line
I want 1 Email ID at 1 Line next at next line if nos od Email ID is fired
plese send me code if any one know

Reply With Quote
  #4 (permalink)  
Old May 21st, 2008, 06:56 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

What exactly do you mean by 'multiple EMail ID come at single line'.

Perhaps show us the XML it is producing and show us what you would like it to look like.

/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert to string prafullaborade XML 7 May 29th, 2008 02:59 PM
code of convert xml data type in string by C# prafullaborade XML 2 May 24th, 2008 07:49 AM
Convert 1 big XML to multiple smaller XML victorcorey XSLT 1 March 20th, 2008 05:59 AM
VB.NET: Convert String and append to Xml files toytoy Pro VB.NET 2002/2003 0 September 2nd, 2004 10:50 PM



All times are GMT -4. The time now is 09:43 PM.


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