Click here to Skip to main content
14,773,798 members
Home » Discussions » XML / XSL
   

XML / XSL

 
QuestionConverting some RTF text to WordML Pin
Ravi Sant8-Feb-11 20:55
MemberRavi Sant8-Feb-11 20:55 
QuestionHelp editing Xml file in C# Pin
jadughar3-Feb-11 22:32
Memberjadughar3-Feb-11 22:32 
AnswerRe: Help editing Xml file in C# Pin
Xmen Real 3-Feb-11 23:03
professional Xmen Real 3-Feb-11 23:03 
GeneralRe: Help editing Xml file in C# Pin
jadughar3-Feb-11 23:38
Memberjadughar3-Feb-11 23:38 
GeneralRe: Help editing Xml file in C# Pin
Xmen Real 3-Feb-11 23:41
professional Xmen Real 3-Feb-11 23:41 
GeneralRe: Help editing Xml file in C# Pin
jadughar3-Feb-11 23:57
Memberjadughar3-Feb-11 23:57 
QuestionBehavior of '+' operator for String in XSL Pin
itsaswath29-Jan-11 7:48
Memberitsaswath29-Jan-11 7:48 
QuestionSilverlight XSD and datatable Pin
Mycroft Holmes17-Jan-11 22:46
professionalMycroft Holmes17-Jan-11 22:46 
I am using Silverlight 4 and WCF

In the WCF I write a datatable to a stringreader and return the string to the UI. In the UI I need to turn the string into an object (Telerik datatable class) which requires that I read the elements to create the columns and the data to populate the rows.

Problem is when the data has null values the xml does not get a full set of elements, the table is invalid in the UI. To solve this I want to include the schema in the string passed to the UI.

However I cannot work out how to get the schema out of the xDocument. This receives the string and creates the xDocument, I then need to get the schema to create the columns

void GenericProcedureCompleted(object sender, GenericProcedureCompletedEventArgs e)
		{
			svcClient.GenericProcedureCompleted -= new EventHandler<GenericProcedureCompletedEventArgs>(GenericProcedureCompleted);
			ShowError(e.sErrorMsg);
			if (!string.IsNullOrEmpty(e.Result))
			{
				System.IO.StringReader sr = new System.IO.StringReader(e.Result);
				XDocument xDoc = XDocument.Load(sr);	
				CreateTable(xDoc);
			}
		}


This is currently using the elements to create the table

xEl = xDoc.Descendants("XMLData").ToList()[0];
				foreach (XElement xe in xEl.Elements())
				{
					oCol = new CTUI.Data.DataColumn();
					oCol.ColumnName = xe.Name.LocalName;
					oCol.DataType = typeof(string);
					dtData.Columns.Add(oCol);
				}


Ant suggestions that are valid for Silverlight 4 will be welcome. Note Silverlight 4 does not support all xml structures.
Never underestimate the power of human stupidity
RAH

GeneralXSL Drop Down Pin
manowj24-Dec-10 22:46
Membermanowj24-Dec-10 22:46 
QuestionHow to deserialize this one Pin
igalep13219-Dec-10 20:12
Memberigalep13219-Dec-10 20:12 
QuestionSaving a word document(2000 to 2010) to xml Pin
Haim Nachum10-Dec-10 7:13
MemberHaim Nachum10-Dec-10 7:13 
GeneralRe: Saving a word document(2000 to 2010) to xml Pin
RaviRanjanKr10-Dec-10 8:46
professionalRaviRanjanKr10-Dec-10 8:46 
QuestionHow do I include PHP codes in an XML file? Pin
Jackaal2-Dec-10 12:54
MemberJackaal2-Dec-10 12:54 
AnswerRe: How do I include PHP codes in an XML file? Pin
Yvan Rodrigues13-Dec-10 15:35
professionalYvan Rodrigues13-Dec-10 15:35 
Questioncreate multiple XML files Pin
hmise30-Nov-10 3:29
Memberhmise30-Nov-10 3:29 
AnswerRe: create multiple XML files Pin
Pete O'Hanlon30-Nov-10 3:57
mvePete O'Hanlon30-Nov-10 3:57 
GeneralRe: create multiple XML files Pin
hmise30-Nov-10 4:20
Memberhmise30-Nov-10 4:20 
GeneralRe: create multiple XML files Pin
Pete O'Hanlon30-Nov-10 5:00
mvePete O'Hanlon30-Nov-10 5:00 
GeneralRe: create multiple XML files Pin
hmise1-Dec-10 3:12
Memberhmise1-Dec-10 3:12 
GeneralRe: create multiple XML files Pin
Pete O'Hanlon1-Dec-10 5:21
mvePete O'Hanlon1-Dec-10 5:21 
QuestionC# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 7:01
MemberWheels01224-Nov-10 7:01 
AnswerRe: C# XML Query Website address based on Website name Pin
Tarun.K.S24-Nov-10 8:30
MemberTarun.K.S24-Nov-10 8:30 
GeneralRe: C# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 8:41
MemberWheels01224-Nov-10 8:41 
GeneralRe: C# XML Query Website address based on Website name Pin
Tarun.K.S24-Nov-10 8:50
MemberTarun.K.S24-Nov-10 8:50 
GeneralRe: C# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 8:59
MemberWheels01224-Nov-10 8:59 

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.