Xml versioning

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Clinton Volzke

    #1

    Xml versioning

    Hi Everyone,

    How do people handle adding of new optional elements and attributes to their
    xml schemas when transferring xml between systems? At the moment we just add
    optional elements/attributes, upgrade the client systems and we havn't had
    any problems.

    Until now. We found out that both systems need the same version otherwise
    the importing system doesn't recognise the new elements/attributes and the
    xml schema validation fails. To get around this I was thinking of doing
    something like:

    string ErrorMessageRes String = GetXmlSchemaExc eptionResString (e.Exception);
    if (ErrorMessageRe sString != "Xml_Unexpected Element" &&
    ErrorMessageRes String != "Xml_Unexpected Attribute")
    {
    Console.WriteLi ne(e.Message);
    }

    string GetXmlSchemaExc eptionResString (XmlSchemaExcep tion e)
    {
    FieldInfo ResField = typeof(XmlSchem aException).Get Field("res",
    BindingFlags.No nPublic | BindingFlags.In stance);
    return (string)ResFiel d.GetValue(e);
    }

    But I was wondering if there was a better way or a better practise.

    Thanks,
    Clint.

Working...