Click here to Skip to main content
15,909,039 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: Display XML to HTML via XSD Pin
Sathesh Sakthivel20-May-07 18:10
Sathesh Sakthivel20-May-07 18:10 
GeneralRe: Display XML to HTML via XSD Pin
George L. Jackson21-May-07 13:13
George L. Jackson21-May-07 13:13 
QuestionXML problem Pin
david bagaturia18-May-07 2:18
david bagaturia18-May-07 2:18 
AnswerRe: XML problem Pin
led mike19-May-07 18:54
led mike19-May-07 18:54 
GeneralRe: XML problem Pin
George L. Jackson20-May-07 3:06
George L. Jackson20-May-07 3:06 
AnswerRe: XML problem Pin
George L. Jackson20-May-07 3:12
George L. Jackson20-May-07 3:12 
GeneralRe: XML problem Pin
david bagaturia20-May-07 19:36
david bagaturia20-May-07 19:36 
QuestionXML Serialization producing empty element when class has attributes Pin
Rob_ICS18-May-07 0:45
Rob_ICS18-May-07 0:45 
I'm trying to serialise a graph structure to XML.

Everything is working fine except for one object which is alwasy coming out as an empty element. Even if I serialise it on its own. Its the most important object as it represents the link. Any idea why it wouldn't show any attributes?

Heres the code:
<br />
[Serializable()]<br />
[System.Xml.Serialization.XmlInclude(typeof(ParticipantNode))]<br />
public class EdgeToNeighbour<br />
{<br />
	#region Private Member Variables<br />
	private string id;<br />
	private Node neighbour;<br />
	#endregion<br />
<br />
	#region Constructors<br />
	public EdgeToNeighbour() <br />
	{<br />
	}<br />
<br />
	public EdgeToNeighbour(Node neighbour)<br />
        {<br />
	  this.neighbour = neighbour;<br />
	  this.id = neighbour.Key;<br />
	}<br />
	#endregion<br />
<br />
	#region Properties<br />
	/// <summary><br />
	/// The neighbour the edge is linking to.<br />
	/// </summary><br />
	public Node Neighbour<br />
	{<br />
		get<br />
		{<br />
			return neighbour;<br />
	        }<br />
	}<br />
	public string ID<br />
	{<br />
		get{return id;}<br />
	}<br />
	#endregion<br />
}<br />


I've tried ignoring the complex type, i've tried adding XML text, I've tried lots of different combinations of XmlAttribute etc. but i always end up with this:

Serialised on its own:
<br />
<EdgeToNeighbour xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /><br />


Serialised as part of the graph structure:
<br />
<anyType xsi:type="Node"><br />
			<Data><br />
				<ID>2</ID><br />
				<TypeID>0</TypeID><br />
				<Name>A Node</Name><br />
			</Data><br />
			<Edges><br />
				<EdgeToNeighbour /><br />
				<EdgeToNeighbour /><br />
			</Edges><br />
</anyType><br />


All I want is for edge to neighbour object to show the attribute ID so I can see the nodes it is linked to.

Thanks in advance.

Rob.
AnswerRe: XML Serialization producing empty element when class has attributes [modified] Pin
Dave Herren23-May-07 14:44
Dave Herren23-May-07 14:44 
Questionsitemap traversing Pin
kumarjammula17-May-07 23:46
kumarjammula17-May-07 23:46 
QuestionSchema troubles. Pin
Alvaro Mendez17-May-07 17:07
Alvaro Mendez17-May-07 17:07 
QuestionXmlReader problem (C# / VB) Pin
Rolf Baxter17-May-07 11:48
Rolf Baxter17-May-07 11:48 
AnswerRe: XmlReader problem (C# / VB) Pin
Stefan Troschuetz18-May-07 5:44
Stefan Troschuetz18-May-07 5:44 
GeneralRe: XmlReader problem (C# / VB) Pin
Rolf Baxter20-May-07 10:13
Rolf Baxter20-May-07 10:13 
QuestionHow to transform string of XML to HTML Pin
jjamjatra17-May-07 10:44
jjamjatra17-May-07 10:44 
QuestionCode generation using XSD Pin
Gokulan Venattil14-May-07 1:56
Gokulan Venattil14-May-07 1:56 
QuestionEquivalent of of html in xsl Pin
vikas198214-May-07 1:31
vikas198214-May-07 1:31 
AnswerRe: Equivalent of of html in xsl Pin
DavidNohejl16-May-07 0:45
DavidNohejl16-May-07 0:45 
AnswerRe: Equivalent of of html in xsl Pin
PIEBALDconsult17-May-07 17:16
mvePIEBALDconsult17-May-07 17:16 
QuestionXSTL Transformation Include in .net 1.1 (Please Help) Pin
Cape Town Developer13-May-07 21:34
Cape Town Developer13-May-07 21:34 
QuestionXML Validation in .NET 2.0 C# Pin
SABhatti11-May-07 5:27
SABhatti11-May-07 5:27 
AnswerRe: XML Validation in .NET 2.0 C# Pin
DavidNohejl16-May-07 0:40
DavidNohejl16-May-07 0:40 
Questionhow to return the xml from a web service and store it into a data grid? Pin
pabloraul10-May-07 9:16
pabloraul10-May-07 9:16 
AnswerRe: how to return the xml from a web service and store it into a data grid? Pin
pabloraul11-May-07 6:07
pabloraul11-May-07 6:07 
QuestionHow to search in XML Pin
Stormint9-May-07 3:25
Stormint9-May-07 3:25 

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.