Click here to Skip to main content
16,005,169 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: removing unwanted empty XML elements (this one contains code in a legible form) [modified] Pin
brifiction24-Apr-10 18:23
brifiction24-Apr-10 18:23 
QuestionRemoving unwanted empty XML elements Pin
Craig Irwin20-May-09 17:22
Craig Irwin20-May-09 17:22 
QuestionASP.Net : Xml Version Format Pin
Vijay Jadhav, India.18-May-09 0:18
Vijay Jadhav, India.18-May-09 0:18 
AnswerRe: ASP.Net : Xml Version Format Pin
Samer Aburabie18-May-09 7:29
Samer Aburabie18-May-09 7:29 
GeneralRe: ASP.Net : Xml Version Format Pin
Vijay Jadhav, India.18-May-09 22:01
Vijay Jadhav, India.18-May-09 22:01 
AnswerRe: ASP.Net : Xml Version Format [modified] Pin
George L. Jackson19-May-09 6:20
George L. Jackson19-May-09 6:20 
GeneralRe: ASP.Net : Xml Version Format Pin
Vijay Jadhav, India.20-May-09 0:55
Vijay Jadhav, India.20-May-09 0:55 
GeneralRe: ASP.Net : Xml Version Format Pin
Vijay Jadhav, India.25-May-09 20:03
Vijay Jadhav, India.25-May-09 20:03 
Hi all,

We have done it. Please view the following code snippet :

#region Create Student Xml String

/* Create Student Xml File */

private string sCreateStudentXml()
{
try
{
Consumer.Sis studentDS = new Consumer.Sis();
Sis.StudentRow student_row = studentDS.Student.NewStudentRow();

student_row.StudentID = 1;
student_row.AcademicDetails = "2008-2009";

studentDS.Student.AddStudentRow(student_row);

Sis.PersonalDetailsRow sub_StudentPersonalDetails_row = studentDS.PersonalDetails.NewPersonalDetailsRow();

sub_StudentPersonalDetails_row.FirstName = "Vijay";
sub_StudentPersonalDetails_row.MiddleName = "Laxmanrao";
sub_StudentPersonalDetails_row.LastName = "Jadhav";
sub_StudentPersonalDetails_row.StudentRow = student_row;
studentDS.PersonalDetails.AddPersonalDetailsRow(sub_StudentPersonalDetails_row);

// Accept the changes
studentDS.AcceptChanges();

System.IO.StringWriter writer = new System.IO.StringWriter();
studentDS.WriteXml(writer, System.Data.XmlWriteMode.IgnoreSchema);

XmlDocument doc = new XmlDocument();
doc.LoadXml(writer.ToString());
XmlNode root = doc.DocumentElement;
XmlAttribute att = doc.CreateAttribute("xsi", "noNamespaceSchemaLocation", "http://www.w3.org/2001/XMLSchema-instance");
att.Value = "Sis.xsd";
root.Attributes.Append(att);
writer = new System.IO.StringWriter();
doc.Save(writer);
string sXML = writer.ToString();
sXML = sXML.Replace("utf-16", "utf-8");
return sXML.ToString();
}
catch (Exception ex)
{
throw ex;
}
}

#endregion

Thanks all for being with me! Smile | :)

Vijay Jadhav.

QuestionASP.NET : Identify XSD on the basis of XML in Web Service [modified] Pin
Vijay Jadhav, India.18-May-09 0:11
Vijay Jadhav, India.18-May-09 0:11 
Questionhow do i delete a xml file ? Pin
YiXiang_8916-May-09 22:47
YiXiang_8916-May-09 22:47 
Questionparse out the member name value Pin
califgal13-May-09 21:22
califgal13-May-09 21:22 
AnswerRe: parse out the member name value Pin
led mike14-May-09 4:36
led mike14-May-09 4:36 
QuestionParsing XML file -exception because element node contains a space in name Pin
califgal13-May-09 16:15
califgal13-May-09 16:15 
AnswerRe: Parsing XML file -exception because element node contains a space in name Pin
Samer Aburabie14-May-09 4:06
Samer Aburabie14-May-09 4:06 
GeneralRe: Parsing XML file -exception because element node contains a space in name Pin
Michael Dunn19-May-09 11:06
sitebuilderMichael Dunn19-May-09 11:06 
QuestionWriting an xml document Pin
dptalt12-May-09 5:55
dptalt12-May-09 5:55 
QuestionStoring binary data in xml file msxml and sending it to client through winsock Pin
hemlat11-May-09 20:27
hemlat11-May-09 20:27 
AnswerRe: Storing binary data in xml file msxml and sending it to client through winsock Pin
led mike12-May-09 4:38
led mike12-May-09 4:38 
QuestionStoring binary data in xml file msxml and sending it to client through winsock Pin
hemlat11-May-09 20:25
hemlat11-May-09 20:25 
AnswerRe: Storing binary data in xml file msxml and sending it to client through winsock Pin
Samer Aburabie14-May-09 4:09
Samer Aburabie14-May-09 4:09 
QuestionI am not able to read xml node in XPathNodeIterator Pin
Naveed72710-May-09 22:32
Naveed72710-May-09 22:32 
QuestionOIM in MSN15 getting error: invalid parameter Pin
amit090210-May-09 21:33
amit090210-May-09 21:33 
QuestionValidating XML file Pin
Sumit Prakash Sharma6-May-09 19:38
professionalSumit Prakash Sharma6-May-09 19:38 
AnswerRe: Validating XML file Pin
led mike7-May-09 4:37
led mike7-May-09 4:37 
QuestionXML / CSL Macros Pin
SimonCropper6-May-09 17:27
SimonCropper6-May-09 17:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.