Hi,
I am wanting to deserialise xml into a series of classes.
For eg;
<PurchaseOrder xmlns:xsi=" xmlns:xsd=" <ShipTo Name="Teresa Atkinson">
<Line1>1 Main St.</Line1>
<Line2>Line2</Line2>
<City>AnyTown</City>
<State>WA</State>
<Zip>00000</Zip>
<Test>Test1</Test>
</ShipTo>
[XmlRoot("PurchaseOrder", IsNullable = false)]
public class PurchaseOrder
{
public Address ShipTo;
}
The deserialsation doesn't work because I have not specified a namespace on the PurchaseOrder object. The xml doesn't contain a namespace...
How can you get around this, could I create a DTD from the XML and reference it as a seperate file or something....?
Any ideas would be helpful.
Thanks
I am wanting to deserialise xml into a series of classes.
For eg;
<PurchaseOrder xmlns:xsi=" xmlns:xsd=" <ShipTo Name="Teresa Atkinson">
<Line1>1 Main St.</Line1>
<Line2>Line2</Line2>
<City>AnyTown</City>
<State>WA</State>
<Zip>00000</Zip>
<Test>Test1</Test>
</ShipTo>
[XmlRoot("PurchaseOrder", IsNullable = false)]
public class PurchaseOrder
{
public Address ShipTo;
}
The deserialsation doesn't work because I have not specified a namespace on the PurchaseOrder object. The xml doesn't contain a namespace...
How can you get around this, could I create a DTD from the XML and reference it as a seperate file or something....?
Any ideas would be helpful.
Thanks