XML Schema – Validate XML with XSD

I'm trying to validate an XML document with an XSD schema and I don't know what's wrong

The mistake I get is the following:
Error in row 8, column 27: & # 39; complexType & # 39; is not allowed in the Sequence Composer. Only elements, groups, selection options, sequences and any elements are allowed.

  1. XML

Antonio PĂ©rez

   Calle Fuente


  1. XSD


Converting Java XSD to Avro – SchemaParseException: roleNotesGroup cannot be redefined

I am working on converting xsd to an avro schema

XSD snippet:


I use

Schema schema = Schema.createRecord(name, null, null, false); 

to create an avro schema data set.
In the xsd above, roleNotesGroup is a child of roleNotesSubGroup, which is a child of roleNotesGroup.
I can get the avro schema recursively up to roleNotesSubGroup, which is then converted to list.

List is obtained recursively.

Now the problem is when I try to add the fields that are formed to the roleNotesGroup header

Schema schema = Schema.createRecord(name, null, null, false);

I get the following error:
SchemaParseException: roleNotesGroup cannot be redefined

Is there a limitation with Avro or Avro conversion that the same names should not appear again?

Design pattern – c # xml import and validation with different document versions without XSD


I have a case where I need to extend some existing functions to load a new version of an XML file into a system (new fields, some mandatory ones that were not previously compulsory, etc.). The file contains some important information, but to keep things simple, I use a simple case.

The XML file can be something like that.

Version 1 (used in the current implementation):


Version 2 (new version, not yet implemented):


  • In version 1, the value in subitem property is not mandatory.
  • In Version 2, the value property in subitem is mandatory and there is a new optional property called description.

Current implementation:

Currently, the system has been developed with hard-coded classes (due to the complexity of class matching between xml and db), and a custom attribute has been used for mandatory value validation.

Similar (only import / export of XML version 1 is supported):

public class Item
  public string Name {get;set;}

  public IList SubItems {get;set;}

public class SubItem
  public string Name {get;set;}

  public string Value {get;set;}

This has also been developed because the missing properties are displayed to the user at some point during the validation process, so that he can fix them immediately (eg by inserting the value into a TextBox).

The problem with this structure is that a new version, which must change the mandatory or non-mandatory properties, requires a change to the current implementation and of course does not work for earlier versions.

Currently, there are no XSD schemas for both versions, just a document that defines this new version (which fields are mandatory, which are new, etc.).

Possible approaches:

One way is to change the class definition to be abstract and to override the properties that have changed in a new version. However, if there are several new versions, it's hard to read and track (multiple versions with multiple changed properties), and multiple property checks have changed), so I'm not sure this is a good approach.

Another approach is to remove the custom attributes and add another level of validation to something else (but I'm not sure what to use). Possibly use a strategy pattern with validation methods, depending on the version.


How else can this problem be tackled? Is there a design pattern that I can follow for these types of scenarios?

Your help is very welcome.

xml – Requesting XSD validation failed when using C # Web service

I've added a reference to a Visual Studio 2017 web service with a third-party WSDL. This is the WSDL:


Consumption is formed from a class in C #:

WSDesmaterializado.RequestWSDesmaterializadoReq l_objRequest = new WSDesmaterializado.RequestWSDesmaterializadoReq();
            WSDesmaterializado.ResponseWSDesmaterializadoResp l_objResponse = new WSDesmaterializado.ResponseWSDesmaterializadoResp();
            WSDesmaterializado.SIOTypeClient l_objConsulta = new WSDesmaterializado.SIOTypeClient();

            l_objRequest.NumeroSolicitud = p_strNumSolicitud;
            l_objRequest.NumeroID = p_intID;
            l_objRequest.TipoID = p_intTipoID;

                l_objResponse = l_objConsulta.WSDesmaterializado(l_objRequest);
                if (l_objResponse != null)
                    if(l_objResponse.respuesta == 1)
                        p_strNombreCliente = l_objResponse.Cliente(0).PrimerNombre + " " + l_objResponse.Cliente(0).SegundoNombre + 
                            " " + l_objResponse.Cliente(0).PrimerApellido + " " + l_objResponse.Cliente(0).SegundoApellido;
                        return true;
                        return false;
                    return false;
            catch (Exception p_objException)
                throw p_objException;

Running WS Consumption generates an xsd validation error:

VR004 – xsd request validation failed (1: 219) cvc-complex-type.2.4.a: Invalid content was found starting with
Element & # 39; soap: body & # 39 ;. One of
& # 39; { "http://schemas.xmlsoap.org/soap/envelope/": header} & # 39; is expected.

When consumed via SoapUI, the service responds, but if it does through the C # project, it will not respond as expected.
I've added the reference to the service as a service reference, as a Web reference I've changed the WSDL with several solutions found on the Web, but still do not get the expected result.

Thank you in advance for your help.

magento2.3.0 – Can we change the xsd file from Magento core modules or use custom xsd files instead of their xsd files?

I have to change that email_templates.xsd File from Magento_Email Module.

So I can change it, if so, how and if not, then I can use a custom file instead of the original .xsd file. I tried to use my custom .xsd file, but it does not work.

Any help would be appreciated.