I am trying to read an XML file containing the following element:
<ho:CODED-TYPE ho:BASE-DATA-TYPE="A_UINT16" CATEGORY="STANDARD-LENGTH-TYPE" ENCODING="UNSIGNED">
My class for describing this node is as follows:
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 can 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 that didn't work either. This time without an error message, but unit test does not allow me to say that the property is still set to "null".
I am completely stuck with this. Therefore any help is appreciated
early
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>