cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to import static XSD into web form via webscript

dafyddjames
Champ in-the-making
Champ in-the-making
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!  Smiley Surprisedops:
1 REPLY 1

dafyddjames
Champ in-the-making
Champ in-the-making
Fixed it! I had the URL of the XSD wrong and I was using the import tag rather than include, even though the namespaces were the same:


<xs:include schemaLocation="webscript://api/path/content/workspace/SpacesStore/Company%20Home/Data%20Dictionary/Web%20Forms/dimensions.xsd?ticket={ticket}" />