XMLファイルを解析すると、次のエラーが発生しますserializer.Deserialize(reader)
。
Namespace prefix \"java\" not defined
私のXMLhttp ://www.virtualdtm.ru/files/serverReplays/rFactorHotlapsData.xml
私のコード
var serializer = new XmlSerializer(typeof(rootDB));
var reader = new XmlTextReader(Server.MapPath(Url.Content("~/Content/xml/rFactorHotlapsData.xml")));
var rFactorHotLapsData = (rootDB)serializer.Deserialize(reader);
私のクラス
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.17929
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Xml.Serialization;
namespace net.vmso.cpanel.Models.rFactorHotLaps
{
}
//
// Этот исходный код был создан с помощью xsd, версия=4.0.30319.17929.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class rootDB {
private rootDBListOfCategory[] itemsField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("listOfCategory", Form=System.Xml.Schema.XmlSchemaForm.Qualified)]
public rootDBListOfCategory[] Items {
get {
return this.itemsField;
}
set {
this.itemsField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class rootDBListOfCategory {
private string categoryNameField;
private rootDBListOfCategoryListOfTrack[] listOfTrackField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string categoryName {
get {
return this.categoryNameField;
}
set {
this.categoryNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("listOfTrack", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public rootDBListOfCategoryListOfTrack[] listOfTrack {
get {
return this.listOfTrackField;
}
set {
this.listOfTrackField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class rootDBListOfCategoryListOfTrack {
private string trackNameField;
private rootDBListOfCategoryListOfTrackSlowestLapRecord[] slowestLapRecordField;
private rootDBListOfCategoryListOfTrackListOfLapRecord[] listOfLapRecordField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string trackName {
get {
return this.trackNameField;
}
set {
this.trackNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("slowestLapRecord", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public rootDBListOfCategoryListOfTrackSlowestLapRecord[] slowestLapRecord {
get {
return this.slowestLapRecordField;
}
set {
this.slowestLapRecordField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("listOfLapRecord", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public rootDBListOfCategoryListOfTrackListOfLapRecord[] listOfLapRecord {
get {
return this.listOfLapRecordField;
}
set {
this.listOfLapRecordField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class rootDBListOfCategoryListOfTrackSlowestLapRecord {
private string driverNameField;
private string sessionNameField;
private string dateField;
private string vehicleModNameField;
private string vehicleNameField;
private string vehicleCategoryField;
private string lapTimeField;
private string lastLapTimeField;
private string rankField;
private string sessionIdField;
private string lapCountField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string driverName {
get {
return this.driverNameField;
}
set {
this.driverNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string sessionName {
get {
return this.sessionNameField;
}
set {
this.sessionNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string date {
get {
return this.dateField;
}
set {
this.dateField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string vehicleModName {
get {
return this.vehicleModNameField;
}
set {
this.vehicleModNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string vehicleName {
get {
return this.vehicleNameField;
}
set {
this.vehicleNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string vehicleCategory {
get {
return this.vehicleCategoryField;
}
set {
this.vehicleCategoryField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string lapTime {
get {
return this.lapTimeField;
}
set {
this.lapTimeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string lastLapTime {
get {
return this.lastLapTimeField;
}
set {
this.lastLapTimeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string rank {
get {
return this.rankField;
}
set {
this.rankField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string sessionId {
get {
return this.sessionIdField;
}
set {
this.sessionIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string lapCount {
get {
return this.lapCountField;
}
set {
this.lapCountField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class rootDBListOfCategoryListOfTrackListOfLapRecord {
private string driverNameField;
private string sessionNameField;
private string dateField;
private string vehicleModNameField;
private string vehicleNameField;
private string vehicleCategoryField;
private string lapTimeField;
private string lastLapTimeField;
private string rankField;
private string sessionIdField;
private string lapCountField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string driverName {
get {
return this.driverNameField;
}
set {
this.driverNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string sessionName {
get {
return this.sessionNameField;
}
set {
this.sessionNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string date {
get {
return this.dateField;
}
set {
this.dateField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string vehicleModName {
get {
return this.vehicleModNameField;
}
set {
this.vehicleModNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string vehicleName {
get {
return this.vehicleNameField;
}
set {
this.vehicleNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string vehicleCategory {
get {
return this.vehicleCategoryField;
}
set {
this.vehicleCategoryField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string lapTime {
get {
return this.lapTimeField;
}
set {
this.lapTimeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string lastLapTime {
get {
return this.lastLapTimeField;
}
set {
this.lastLapTimeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string rank {
get {
return this.rankField;
}
set {
this.rankField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string sessionId {
get {
return this.sessionIdField;
}
set {
this.sessionIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string lapCount {
get {
return this.lapCountField;
}
set {
this.lapCountField = value;
}
}
}
[1]: