cos-nonambig Error

This should cover W3C XML Schema, Relax NG and DTD related problems.
Jarva5
Posts: 1
Joined: Tue Aug 21, 2007 11:01 am

cos-nonambig Error

Post by Jarva5 » Tue Aug 21, 2007 11:09 am

Hi, i'm having this problem with my XSD:

Code: Select all


[ERROR] cos-nonambig: "":idAplicacion and "":idAplicacion (or elements from thei
r substitution group) violate "Unique Particle Attribution". During validation a
gainst this schema, ambiguity would be created for those two particles.
line 483 of firmaModificado.xsd
I don't know how i can solve it. I've been searching on this phorum, but i haven't any idea.

My xsd is so long, so i put the parts where i think there is the problem:

Code: Select all


.......
<xs:element name="parametros">
<xs:complexType>
<xs:choice>
<xs:group ref="wsfirma:Validar1"/>
<xs:group ref="wsfirma:Firma1"/>
</xs:choice>
</xs:complexType>
</xs:element>

<xs:group name="Validar1">
<xs:sequence>
<xs:group ref="wsfirma:IdAplicacion"/>
<xs:group ref="wsfirma:FirmaElectronica"/>
<xs:group ref="wsfirma:FormatoFirma" minOccurs="0"/>
<xs:group ref="wsfirma:Hash" minOccurs="0"/>
<xs:group ref="wsfirma:AlgoritmoHash" minOccurs="0"/>
<xs:group ref="wsfirma:Datos" minOccurs="0"/>
</xs:sequence>
</xs:group>

<xs:group name="Firma1">
<xs:sequence>
<xs:group ref="wsfirma:IdAplicacion"/>
<xs:group ref="wsfirma:IdDocumento"/>
<xs:group ref="wsfirma:Firmante"/>
<xs:group ref="wsfirma:IdReferencia" minOccurs="0"/>
<xs:group ref="wsfirma:AlgoritmoHash" minOccurs="0"/>
<xs:group ref="wsfirma:FormatoFirma" minOccurs="0"/>
</xs:sequence>
</xs:group>

<xs:group name="IdAplicacion">
<xs:sequence>
<xs:element name="idAplicacion" type="xs:string"/>
</xs:sequence>
</xs:group>
.....
Thanks!!

jkmyoung
Posts: 89
Joined: Mon Mar 06, 2006 10:13 pm

Post by jkmyoung » Tue Aug 21, 2007 6:43 pm

The problem is that once the parser encounters the IdAplicacion group, it doesn't know which main group that this is a part of. Try instead:

<xs:element name="parametros">
<xs:complexType>
<xs:sequence>
<xs:group ref="wsfirma:IdAplicacion"/>
<xs:choice>
<xs:group ref="wsfirma:Validar1"/>
<xs:group ref="wsfirma:Firma1"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:group name="Validar1">
<xs:sequence>
<xs:group ref="wsfirma:FirmaElectronica"/>
<xs:group ref="wsfirma:FormatoFirma" minOccurs="0"/>
<xs:group ref="wsfirma:Hash" minOccurs="0"/>
<xs:group ref="wsfirma:AlgoritmoHash" minOccurs="0"/>
<xs:group ref="wsfirma:Datos" minOccurs="0"/>
</xs:sequence>
</xs:group>

<xs:group name="Firma1">
<xs:sequence>
<xs:group ref="wsfirma:IdDocumento"/>
<xs:group ref="wsfirma:Firmante"/>
<xs:group ref="wsfirma:IdReferencia" minOccurs="0"/>
<xs:group ref="wsfirma:AlgoritmoHash" minOccurs="0"/>
<xs:group ref="wsfirma:FormatoFirma" minOccurs="0"/>
</xs:sequence>
</xs:group>

Post Reply