I am having trouble with the example in Appendix B: http://static.springframework.org/sp...sible-xml-meat
I have created my own namespace with custom elements, but i am not able to nest the elements within each other. My goal is for my xml to look like this:
The error I am getting is:Code:<itp:dateCell ....> <itp:dateCell ..../> <itp:dateCell ..../> </itp:dateCell>
org.xml.sax.SAXParseException: src-resolve.4: Components from namespace 'http://www.springframework.org/schema/itp' are not referenceable from schema document 'http://www.itpcorporation.com/schema/itp/itp.xsd'.
and its being referenced to the bold line in the schema below.
This is my Schema:
I also have other elements in this schema and when i take dateCell out, i do not get any errors, but i am not able to nest.Code:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:schema xmlns="http://www.springframework.org/schema/itp" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans" targetNamespace="http://www.itpcorporation.com/schema/itp" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xsd:import namespace="http://www.springframework.org/schema/beans"/> <xsd:element name="dateCell"> <xsd:complexType> <xsd:complexContent> <xsd:extension base="beans:identifiedType"> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element ref="dateCell"/> </xsd:choice> <xsd:attribute .../> <xsd:attribute .../> <xsd:attribute .../> <xsd:attribute .../> </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:element>
The only difference between my code and the code in the example from the spring documentation is that the class I am trying to nest has a setter method for the List type. Because of this, i modified the code in the factory bean for method getObject() to look like this:
I really need help understanding whats wrong with my code and/or approach. Thanks.Code:public Object getObject() throws Exception { this.parent.setAuxiliaryList(children); return this.parent; }


Reply With Quote