I've uploaded a ZIP file containing both the XML file I'm trying to read and the corresponding XSD files to http://www.bonnland.de/FIBEX.zip
I'm trying to deserialize the following XML (fragment) using XmlSerializer. While doing so I get the error: (Sorry for it being German I'll give a rough translation in italics)
System.InvalidOperationException==>Fehler im XML-Dokument (90,7). System.InvalidOperationException==>Der angegebene Typ wurde nicht erkannt: Name='CONTROLLER-TYPE', Namespace='http://www.asam.net/xml/fbx/can', bei .
This translates as something like:
System.InvalidOperationException==>error in XML document (90,7). System.InvalidOperationException==>the given type could not be found: Name='CONTROLLER-TYPE', Namespace='http://www.asam.net/xml/fbx/can', at
Here's the source document:
<fx:ECU ID="ecuSpeedControl">
<ho:SHORT-NAME>SpeedControl</ho:SHORT-NAME>
<ho:DESC>ECU controlling drive speed</ho:DESC>
<fx:CONTROLLERS>
<fx:CONTROLLER xsi:type="can:CONTROLLER-TYPE" ID="ctrlSpeedControl">
<ho:SHORT-NAME>ctrlSpeedControl</ho:SHORT-NAME>
<ho:DESC>CAN controller of ECU</ho:DESC>
<fx:CHIP-NAME>SJA1000</fx:CHIP-NAME>
<can:TIME-SEG0>11</can:TIME-SEG0>
<can:TIME-SEG1>4</can:TIME-SEG1>
<can:SYNC-JUMP-WIDTH>2</can:SYNC-JUMP-WIDTH>
<can:NUMBER-OF-SAMPLES>1</can:NUMBER-OF-SAMPLES>
</fx:CONTROLLER>
</fx:CONTROLLERS>
</fx:ECU>
The root element is:
<fx:FIBEX xmlns:fx="http://www.asam.net/xml/fbx" xmlns:ho="http://www.asam.net/xml"
xmlns:can="http://www.asam.net/xml/fbx/can" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="fibex4can.xsd" VERSION="3.1.0">
the class definition for this fragment is:
public ref class FIBEXECU : AbstractFIBEXNode, IGenericContainable
{
public:
ref class ControllersContainer : FIBEXGenericContainer<FIBEXController^>{
public:
[XmlElement("CONTROLLER")]
property array<FIBEXController^>^ ControllerObjs {
array<FIBEXController^>^ get() { return Children;}
void set(array<FIBEXController^>^ value) { Children = value;}
}
};
[XmlAttribute("ID")]
virtual property String^ ID;
[XmlElement("SHORT-NAME", Namespace="http://www.asam.net/xml")]
property String^ ShortName;
[XmlElement("CONTROLLERS")]
property ControllersContainer^ Controllers;
};
I hope that (yet again) someone can help me, as I didn't find a solution on google or here.