cancel
Showing results for 
Search instead for 
Did you mean: 

maxOccurs='unbounded'

nyronian
Champ in-the-making
Champ in-the-making
I have the following xsd used to "Create Content" to XML:

<?xml version="1.0" encoding="UTF-8"?>
<!–W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)–>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="title" type="xs:normalizedString"/>
   <xs:element name="text" type="xs:string"/>
   <xs:element name="picture" type="xs:anyURI"/>
   <xs:element name="heading" type="xs:normalizedString"/>
   <xs:element name="document">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="ContentHeadingMain"/>
            <xs:element ref="ContentHeading"/>
            <xs:element ref="Features"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="Features">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="heading"/>
            <xs:element ref="ContentFeature" minOccurs="1" maxOccurs="unbounded"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="ContentHeadingMain">
      <xs:complexType>
         <xs:attribute name="title" type="xs:normalizedString" use="required"/>
      </xs:complexType>
   </xs:element>
   <xs:element name="ContentHeading">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="title"/>
            <xs:element ref="text"/>
            <xs:element ref="picture"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="ContentFeature">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="text"/>
            <xs:element ref="picture"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

Notice the ContentFeature type is an "unbounded" occurance.  For some reason the "+" sign does not show up in the editor for the XML.  Is there something I'm missing?  Does that feature work for complex types?

Thank you for your help….
5 REPLIES 5

arielb
Champ in-the-making
Champ in-the-making
it should definitely be showing a +.  what version of the software are you using?

nyronian
Champ in-the-making
Champ in-the-making
2.0 release…not sure what build….is there a way to verify?

arielb
Champ in-the-making
Champ in-the-making
hi - i'm reproducing this issue on the current development branch - so it's not just your install.  i've filed a jira issue for it (http://issues.alfresco.com/browse/WCM-508).  i'm guessing it's related to how the schema is constructed, but i'll have more information once the problem is fixed (which should be quite soon).

arielb
Champ in-the-making
Champ in-the-making
the problem has to do with how the schema to xforms converter deals with elements refs.  it is gonna be fixed in 2.1.  in the meantime, a workaround is to do this:


<?xml version="1.0" encoding="UTF-8"?>
<!–W3C Schema generated by XMLSpy v2007 sp2 (http://www.altova.com)–>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="title" type="xs:normalizedString"/>
   <xs:element name="text" type="xs:string"/>
   <xs:element name="picture" type="xs:anyURI"/>
   <xs:element name="heading" type="xs:normalizedString"/>
   <xs:element name="document">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="ContentHeadingMain"/>
            <xs:element ref="ContentHeading"/>
            <xs:element ref="Features"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="Features">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="heading"/>
            <xs:element name="ContentFeature" minOccurs="1" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element ref="text"/>
                  <xs:element ref="picture"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="ContentHeadingMain">
      <xs:complexType>
         <xs:attribute name="title" type="xs:normalizedString" use="required"/>
      </xs:complexType>
   </xs:element>
   <xs:element name="ContentHeading">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="title"/>
            <xs:element ref="text"/>
            <xs:element ref="picture"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>

</xs:schema>

kvc
Champ in-the-making
Champ in-the-making
As a follow-up, this is fixed in our upcoming 2.1 Community release (due today):

http://issues.alfresco.com/browse/WCM-508


Kevin
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.