AnsweredAssumed Answered

modelSchema.xsd does not prevent us from bad extensions

Question asked by eburriel on Nov 22, 2006
I found a valid but dangerous extension of the document model (see name

<type name="sample:folder">
<title>Folder</title>
<parent>cm:folder</parent>
<properties>
<property name="sample:folder:specialinfo">
<title>specialinfo</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
</type>

It respects the http://www.alfresco.org/specification/model/dictionary/1.0/modelSchema.xsd.
through
<xs:complexType name="property">….
<xs:attributeGroup ref="dd:name"/>
</xs:complexType>

<xs:attributeGroup name="name">
<xs:attribute name="name" type="xs:string" use="required" />
</xs:attributeGroup>

According to the XSD, the attribut 'name' in element 'property' should be a 'xs:string'.

So my extension seems valid and can be use in Alfresco.
But when you try export  you obtain an acp.
Here's a corresponding extract:

<view:properties>
      <cm:modifier>System</cm:modifier>
      <cm:modified>2006-11-21T17:13:46.476+01:00</cm:modified>
      <sys:node-uuid>313b7591-797b-11db-afc3-a7d82b08af01</sys:node-uuid>
      ….
      <sample:folder:specialinfo>A</sample:folder:specialinfo>
      ….
      <cm:created>2006-11-21T17:13:15.288+01:00</cm:created>
    </view:properties>

And when you want to import the parse fails on the tag sample:folder:specialinfo which is not considered as a valid QName.

What i understood is that the attribute 'name' in 'property', 'child-association' and 'association' should be a valid QName which quite more precise than just 'xs:string'.

It will be nice if the XSD integrates this restriction… ( xs:QName)

Thanks for any response.

Outcomes