cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Importing XSD

trgerhardt
Champ in-the-making
Champ in-the-making
What do I need to have the schema attributes set to, to include another schema and not get an error, for example:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="object" type="objectType" />
 
  <xs:include schemaLocation="/includes/schemas/image_list.xsd"/>

  <xs:complexType name="objectType">
    <xs:sequence>
      <xs:element name="name" type="xs:normalizedString" />
      <xs:element name="image" type="imageType" minOccurs="0" />
    </xs:sequence> 
  </xs:complexType>
   
</xs:schema>

The included XSD:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:complexType name="imageType">
    <xs:sequence>
      <xs:element name="title" type="xs:normalizedString" minOccurs="0" />
      <xs:element name="filename" type="image_list" />
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="image_list">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="first_image.jpg" />
      <xs:enumeration value="second_image.jpg" />
      <xs:enumeration value="third_image.jpg" />
      <xs:enumeration value="fourth_image.jpg" />     
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
   

The error message I am getting:
org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 11 column 64: src-resolve: Cannot resolve the name 'imageType' to a(n) 'type definition' component.
5 REPLIES 5

nikhil
Champ in-the-making
Champ in-the-making
i think the problem lies in the include statement.

are you sure that is the right path to be provided?

That seems much more like we provide the path in OPENCMS rather than alfresco :idea:

trgerhardt
Champ in-the-making
Champ in-the-making
The directory structure inside my sandbox that I am using this web form in looks like:

/ROOT/includes/schemas/

I think the path is correct but are there any other changes I need to make if I am keeping a schema in my Web Project?

nikhil
Champ in-the-making
Champ in-the-making
Hi,

If you are successful in importing the xsd, please share the information with us here..

Thanks,

Warm Regards,
Nikhil

trgerhardt
Champ in-the-making
Champ in-the-making
It must be successful in importing the schema because I get a different error when I enter the wrong schema name:
org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 4 column 144: schema_reference.4: Failed to read schema document 'http://tgerhard.intranet.www--sandbox.165-160-208-62.ip.alfrescodemo.net:8180/includes/schemas/image...', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .

trgerhardt
Champ in-the-making
Champ in-the-making
Hey Thanks for looking into this for me but I figured out what was wrong. I wasn't getting this error originally but after a few different tries it told me that the include statement needed to be before any element statement. So my solution looked like:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:include schemaLocation="/includes/schemas/image_list.xsd"/>

  <xs:element name="object" type="objectType" />
…….