Click here to Skip to main content
14,490,096 members
   

XML / XSL

 
QuestionConverting some RTF text to WordML Pin
Ravi Sant8-Feb-11 19:55
MemberRavi Sant8-Feb-11 19:55 
QuestionHelp editing Xml file in C# Pin
jadughar3-Feb-11 21:32
Memberjadughar3-Feb-11 21:32 
AnswerRe: Help editing Xml file in C# Pin
Xmen Real 3-Feb-11 22:03
professional Xmen Real 3-Feb-11 22:03 
GeneralRe: Help editing Xml file in C# Pin
jadughar3-Feb-11 22:38
Memberjadughar3-Feb-11 22:38 
GeneralRe: Help editing Xml file in C# Pin
Xmen Real 3-Feb-11 22:41
professional Xmen Real 3-Feb-11 22:41 
GeneralRe: Help editing Xml file in C# Pin
jadughar3-Feb-11 22:57
Memberjadughar3-Feb-11 22:57 
QuestionBehavior of '+' operator for String in XSL Pin
itsaswath29-Jan-11 6:48
Memberitsaswath29-Jan-11 6:48 
QuestionSilverlight XSD and datatable Pin
Mycroft Holmes17-Jan-11 21:46
professionalMycroft Holmes17-Jan-11 21: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 21:46
Membermanowj24-Dec-10 21:46 
QuestionHow to deserialize this one Pin
igalep13219-Dec-10 19:12
Memberigalep13219-Dec-10 19:12 
QuestionSaving a word document(2000 to 2010) to xml Pin
Haim Nachum10-Dec-10 6:13
MemberHaim Nachum10-Dec-10 6:13 
GeneralRe: Saving a word document(2000 to 2010) to xml Pin
RaviRanjanKr10-Dec-10 7:46
professionalRaviRanjanKr10-Dec-10 7:46 
QuestionHow do I include PHP codes in an XML file? Pin
Jackaal2-Dec-10 11:54
MemberJackaal2-Dec-10 11:54 
AnswerRe: How do I include PHP codes in an XML file? Pin
Yvan Rodrigues13-Dec-10 14:35
subeditorYvan Rodrigues13-Dec-10 14:35 
Questioncreate multiple XML files Pin
hmise30-Nov-10 2:29
Memberhmise30-Nov-10 2:29 
AnswerRe: create multiple XML files Pin
Pete O'Hanlon30-Nov-10 2:57
subeditorPete O'Hanlon30-Nov-10 2:57 
GeneralRe: create multiple XML files Pin
hmise30-Nov-10 3:20
Memberhmise30-Nov-10 3:20 
GeneralRe: create multiple XML files Pin
Pete O'Hanlon30-Nov-10 4:00
subeditorPete O'Hanlon30-Nov-10 4:00 
GeneralRe: create multiple XML files Pin
hmise1-Dec-10 2:12
Memberhmise1-Dec-10 2:12 
GeneralRe: create multiple XML files Pin
Pete O'Hanlon1-Dec-10 4:21
subeditorPete O'Hanlon1-Dec-10 4:21 
QuestionC# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 6:01
MemberWheels01224-Nov-10 6:01 
AnswerRe: C# XML Query Website address based on Website name Pin
Tarun.K.S24-Nov-10 7:30
MemberTarun.K.S24-Nov-10 7:30 
GeneralRe: C# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 7:41
MemberWheels01224-Nov-10 7:41 
GeneralRe: C# XML Query Website address based on Website name Pin
Tarun.K.S24-Nov-10 7:50
MemberTarun.K.S24-Nov-10 7:50 
GeneralRe: C# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 7:59
MemberWheels01224-Nov-10 7: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.