AnsweredAssumed Answered

alfresco cannot recognize xs:attribute in xsd file

Question asked by johnhelen on Jan 7, 2009
Hello all

I have a xsd file like this

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs=""

<xs:element name="mytype" type="my:MyType"/>

<xs:complexType name="MyType">
            <xs:element name="id" type="xs:string"/>
            <xs:element name="attributes" minOccurs="1" maxOccurs="1">
                        <xs:element name="attribute" type="my:AttributeType" minOccurs="1" maxOccurs="unbounded" />

<xs:complexType name="AttributeType">
            <xs:element name="value" type="xs:string"/>
        <xs:attribute name="key" type="xs:string"/>


From that xsd file, I want to create  xml files like this:

         <my:attribute my:key="mykey">

However, when I create a xml file based on this xsd schema, I always get this error when entering field "Key" in the form:

ERROR [alfresco.ajax] Failed to execute method XFormsBean.setXFormsValue: Exception in Transaction.
org.alfresco.error.AlfrescoRuntimeException: Exception in Transaction.
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(

Caused by: org.chiba.xml.xforms.exception.XFormsException: model item for path '/my:mytype/my:attributes/my:attribute[position() != last()][1]/@key' does not exist

Then a xml file is created but the value for my:key is always empty

I do not why, please help
many thanks for any help