Jump to content

Another maxOccurs problem! (not same user)


Recommended Posts

Hi out there!I just read the maxOccurs problem, and I have a similar (but not sur if is the same) problem. Here is my schema:<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:attribute name="ComponentName" type="xs:string"> <xs:annotation> <xs:documentation>Nombre del componente</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="ClassName" type="xs:string"> <xs:annotation> <xs:documentation>Nombre de la clase</xs:documentation> </xs:annotation> </xs:attribute> <xs:element name="TPersistent"> <xs:annotation> <xs:documentation>Clase del TPersistent</xs:documentation> </xs:annotation> <xs:complexType> <xs:all> <xs:element ref="TComponent" minOccurs="0" maxOccurs="unbounded"/> <---------------look here </xs:all> <xs:attribute ref="ClassName" use="required"/> </xs:complexType> </xs:element> <xs:element name="TComponent"> <xs:annotation> <xs:documentation>Clase del TComponent</xs:documentation> </xs:annotation> <xs:complexType> <xs:all> <xs:element ref="TProperty" minOccurs="0" maxOccurs="unbounded"/> <---------------and here </xs:all> <xs:attribute ref="ComponentName" use="required"/> </xs:complexType> </xs:element> <xs:element name="TProperty"> <xs:complexType> <xs:all> <xs:element name="name"> <xs:annotation> <xs:documentation>Nombre de la propiedad</xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="([a-zA-Z0-9_])*"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="value" type="xs:string"> <xs:annotation> <xs:documentation>Valor de la propiedad</xs:documentation> </xs:annotation> </xs:element> <xs:element name="descendants" type="xs:boolean" default="false"/> </xs:all> </xs:complexType> </xs:element></xs:schema>I practically copied the example, but the validator says:file:/usr/local/XSV/xsvlog/tmplzMbnZuploaded:20:5: Invalid per cvc-attribute.1.2: attribute type check failed for {None}:maxOccurs: unbounded not in enumeration [0, 1]file:/usr/local/XSV/xsvlog/tmplzMbnZuploaded:31:5: Invalid per cvc-attribute.1.2: attribute type check failed for {None}:maxOccurs: unbounded not in enumeration [0, 1]and Altova says:Value 'unbounded' is not allowed for attribute 'maxOccurs'. Reason: it does not match any of the defined enumerations (see below) '0' '1' Error location: xs:schema / xs:element / xs:complexType / xs:all / xs:element / @maxOccurs Details cvc-enumeration-valid: 'unbounded' is none of the values specified by the enumerations of type '{anonymous}'. cvc-datatype-valid.2: The value 'unbounded' is not a member of type definition '{anonymous}'. cvc-simple-type.1: For type definition '{anonymous}' the string 'unbounded' is not valid. cvc-attribute.3: Value 'unbounded' of attribute 'maxOccurs' does not match simple type definition '{anonymous}'. cvc-complex-type.3.1: The attribute 'maxOccurs' of complex type 'xs:narrowMaxMin' is not valid. cvc-elt.5.2.1: The element <xs:element> is not valid with respect to the actual type definition 'xs:narrowMaxMin'.However, I can't discover what am I doing wrong. Despite of not being valid, Altova displays (correctly) both TComponent and TProperty as 0 to infinty ocurrencesAny ideas?Thanks in advance,Alvaro Castiello

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...