I try to read an XML file that contains the following element:
<ho:CODED-TYPE ho:BASE-DATA-TYPE="A_UINT16" CATEGORY="STANDARD-LENGTH-TYPE" ENCODING="UNSIGNED">
My class to describe this node looks like that:
public ref class FIBEXCodedType
{
public:
[XmlAttribute("ho:BASE-DATA-TYPE")]
property String^ BaseDataType;
[XmlAttribute("CATEGORY")]
property String^ Category;
[XmlAttribute("ENCODING")]
property String^ Encoding;
FIBEXCodedType(void);
};
I get an InvalidOperationException from XmlSerializer.ctor telling me:
"Ungültiges Namenszeichen in 'ho:BASE-DATA-TYPE'." (this could be translated as "invalid character in: 'ho:BASE-DATA-TYPE'").
I also tried the following:
[XmlAttribute("BASE-DATA-TYPE", Namespace="http://www.asam.net/xml")]
property String^ BaseDataType;
But this didn't work either. This time without the error message but the unit test fails telling me, that the property is still set to "null".
I am completely stuck with this. So any help is appreciated
thanks in advance
EDIT: some more XML
<?xml version="1.0" ?>
<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">
<fx:CODING ID="codingSpeed">
<ho:SHORT-NAME>CodingSpeed</ho:SHORT-NAME>
<ho:DESC>Coding for speed values within this system.</ho:DESC>
<ho:CODED-TYPE ho:BASE-DATA-TYPE="A_UINT16" CATEGORY="STANDARD-LENGTH-TYPE" ENCODING="UNSIGNED">
<ho:BIT-LENGTH>16</ho:BIT-LENGTH>
</ho:CODED-TYPE>
</fx:CODING>