AnsweredAssumed Answered

Unable to import static XSD into web form via webscript

Question asked by dafyddjames on Oct 28, 2010
Latest reply on Oct 28, 2010 by dafyddjames
Hi,

I've been following the instructions on Peter Monks' blog for including a static XSD in a Web Form but I'm having trouble getting it to work.

My schema to be included returns the following XML:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:alf="http://www.alfresco.org/"
           xmlns:bf="http://www.bf.com/ns"
           targetNamespace="http://www.bf.com/ns"
           elementFormDefault="qualified">

<xs:simpleType name="theme">
  <xs:restriction base="xs:string">
    <xs:enumeration value="ALL_THEMES"/>
    <xs:enumeration value="generic"/>
    <xs:enumeration value="prospect"/>
    <xs:enumeration value="retention"/>
    <xs:enumeration value="returningprospect"/>
    <xs:enumeration value="rtd"/>
    <xs:enumeration value="unfunded"/>
  </xs:restriction>
</xs:simpleType>

</xs:schema>

Here's the actual schema code:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:alf="http://www.alfresco.org"
           xmlns:bf="http://www.bf.com/ns"
           targetNamespace="http://www.bf.com/ns"
           elementFormDefault="qualified">
 
  <xs:import schemaLocation="webscript://api/path/content/workspace/SpacesStore/Company%20Home/Web%20Forms/dimensions.xsd?ticket={ticket}" />
 
  <xs:element name="content">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="theme" type="bf:theme" />
    </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

Problem is, when I try to create new web forms content using the above schema, I get an error:
org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 16 column 51: src-resolve: Cannot resolve the name 'bf:theme' to a(n) 'type definition' component.

Can someone help please?

PS. I originally posted this in the General WCM forum, but it occurred to me that it's more a development question so should sit in here instead. Apologies for the cross-posting!  :oops:

Outcomes