That's what I thought - I've tried everything you've mentioned, including Validation with xerces - it does not complain at all, it validates fine. It's rather Frustrating. I've even tried removing the prolog completely, and I still get the same error...
> -----Original Message----- > From: Keith Visco [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 23, 2002 3:47 PM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] Problems unmarshaling; throwing SaxException: > Content is not allowedin prolog. > > > > The prolog is the beginning section of the XML document that > contains the XML declaration and doctype information. > Perhaps you have some whitespace before the XML declaration > that is causing problems with Xerces. > > You can try parsing your XML directly with the XML parser > to see if you get a better error message. > > --Keith > > Glenn Hemming wrote: > > > > I'm getting the following error while attempting to invoke > > unmarshal(FileReader) > > To unmarshal an XML document: > > > > org.xml.sax.SAXException: Content is not allowed in prolog. > > > > At > > org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java > > :979) > > at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:338) > > at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:270) > > at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:391) > > > > I've been working on it all morning and I just can't get it to go. > > Here are my xml document and my XML Schema that I supplied to > > SourceGenerator: > > > > XML Document > > ------------ > > <?xml version="1.0"?> > > <project> > > > > <config> > > <name>test</name> > > <company>test</company> > > <author>test</author> > > <version>test</version> > > <copyright>test</copyright> > > <comment>test</comment> > > <project-home>test</project-home> > > <database-schema>test</database-schema> > > </config> > > > > <beans> > > <bean> > > <type>test</type> > > <package>test</package> > > <name>test</name> > > <remote>test</remote> > > <remote-home>test</remote-home> > > <local>test</local> > > <local-home>test</local-home> > > <transaction-type>test</transaction-type> > > <persistence-type>test</persistence-type> > > <reentrant>test</reentrant> > > > > <abstract-schema-name>test</abstract-schema-name> > > <attributes> > > <attribute> > > <name>test</name> > > <type>test</type> > > <modifier>test</modifier> > > <primary-key>test</primary-key> > > </attribute> > > <attribute> > > <name>test</name> > > <type>test</type> > > <modifier>test</modifier> > > <primary-key>test</primary-key> > > </attribute> > > </attributes> > > <methods> > > <method> > > <name>test</name> > > <return-type>test</return-type> > > <param> > > <name>test</name> > > <type>test</type> > > </param> > > </method> > > <method> > > <name>test</name> > > <return-type>test</return-type> > > <params> > > <param> > > > > <name>test</name> > > > > <type>test</type> > > </param> > > </params> > > </method> > > </methods> > > <table-mapping> > > <name>test</name> > > <columns> > > <column> > > <name>test</name> > > > > <attribute-name>test</attribute-name> > > </column> > > <column> > > <name>test</name> > > > > <attribute-name>test</attribute-name> > > </column> > > </columns> > > </table-mapping> > > <patterns> > > <pattern name="test"/> > > <pattern name="test"/> > > </patterns> > > </bean> > > </beans> > > </project> > > > > XML Schema > > ---------- > > > > <?xml version="1.0"?> > > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > > targetNamespace="http://j2ee-dev-studio.sourceforge.net/Project"> > > > > <xsd:annotation> > > <xsd:documentation> > > This is the XML Schema for a J2EE Development Studio > > project. > > </xsd:documentation> > > </xsd:annotation> > > > > <xsd:element name="project"> > > <xsd:annotation> > > <xsd:documentation> > > J2EE Development Studio project. > > </xsd:documentation> > > </xsd:annotation> > > > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element ref="config" maxOccurs="1" minOccurs="1"/> > > <xsd:element ref="beans" maxOccurs="1" minOccurs="0"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of the config --> > > <xsd:element name="config"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element name="name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="company" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="author" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="version" > > type="xsd:float" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="copyright" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="comment" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="project-home" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="database-schema" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of the beans --> > > <xsd:element name="beans"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element ref="bean" maxOccurs="unbounded" > > minOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of a bean--> > > <xsd:element name="bean"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element name="type" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="package" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="remote" > > type="xsd:string" minOccurs="0" maxOccurs="1"/> > > <xsd:element name="remote-home" > > type="xsd:string" minOccurs="0" maxOccurs="1"/> > > <xsd:element name="local" > > type="xsd:string" minOccurs="0" maxOccurs="1"/> > > <xsd:element name="local-home" > > type="xsd:string" minOccurs="0" maxOccurs="1"/> > > <xsd:element name="trasaction-type" > > type="xsd:string" minOccurs="0" maxOccurs="1"/> > > <xsd:element name="persistence-type" > > type="xsd:string" minOccurs="0" maxOccurs="1"/> > > <xsd:element name="abstract-schema-name" > > type="xsd:string" minOccurs="0" maxOccurs="1"/> > > <xsd:element ref="attributes" > > minOccurs="0" maxOccurs="1"/> > > <xsd:element ref="methods" minOccurs="0" > > maxOccurs="1"/> > > <xsd:element ref="table-mapping" > > minOccurs="0" maxOccurs="1"/> > > <xsd:element ref="patterns" > > minOccurs="0" maxOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of the attributes --> > > <xsd:element name="attributes"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element ref="attribute" maxOccurs="unbounded" > > minOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of an attribute --> > > <xsd:element name="attribute"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element name="name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="type" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="primary-key" > > type="xsd:boolean" minOccurs="0" maxOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of the methods --> > > <xsd:element name="methods"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element ref="method" > > maxOccurs="unbounded" minOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of a method --> > > <xsd:element name="method"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element name="name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="return-type" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element ref="params" maxOccurs="unbounded" > > minOccurs="0"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of the params --> > > <xsd:element name="params"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element ref="param" > > maxOccurs="unbounded" minOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of a param --> > > <xsd:element name="param"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element name="name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="type" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of a table-mapping --> > > <xsd:element name="table-mapping"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element name="name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element ref="columns" maxOccurs="1" > > minOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of columns --> > > <xsd:element name="columns"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element ref="column" > > maxOccurs="unbounded" minOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of a column --> > > <xsd:element name="column"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element name="name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > <xsd:element name="attribute-name" > > type="xsd:string" minOccurs="1" maxOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of patterns --> > > <xsd:element name="patterns"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element ref="pattern" > > maxOccurs="unbounded" minOccurs="1"/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > <!-- Description of a pattern --> > > <xsd:element name="pattern"> > > <xsd:complexType> > > <xsd:attributeGroup ref="patternAttributes"/> > > </xsd:complexType> > > </xsd:element> > > > > <!-- The attributes for a pattern --> > > <xsd:attributeGroup name="patternAttributes"> > > <xsd:attribute name="name" type="xsd:string" > > use="required"/> > > </xsd:attributeGroup> > > > > </xsd:schema> > > > > Any help with this would be greatly appreciated. > > > > Glenn > > > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send mail to > > [EMAIL PROTECTED] with a subject of: > > unsubscribe castor-dev > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
