Hi,

Comments below.

On Wednesday, June 25, 2003, at 10:34 AM, Nguyen Luc wrote:
I got a�XML schema and�a�XSD schema, when i pass for to generate the objets from XSD schema, i got the following error :

C:\castor\Jalil>java org.exolab.castor.builder.SourceGenerator -i modele.xsd -package javaxml
org.xml.sax.SAXException: In document: 'file:///C:/castor/Jalil/modele.xsd'
Parsing Error : Content is not allowed in prolog.
Line : 1
Column : 1
������� at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
������� at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenera
tor.java:518)
������� at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenera
tor.java:571)
������� at org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:1
126)

I don't have an answer for you, but I can give you some vague pointers. First, FYI: this error is a general XML error, not something specific to Castor.


The message means that the parser is finding extra information in the prolog (the <?xml ... ?> bit) of c:\castor\Jalil\modele.xsd. You should try doing a well-formedness check with another tool to see if it gives you a more useful error message.

One possibility is that the character set of the file isn't actually the declared iso-8859-1.

Finally (though I don't think that it would affect this particular problem) the file you provided is not an XML Schema. It appears to be an instance document. Schemas have (among other things) <xsd:schema> as the root element. If this is in fact "modele.xsd," Source Generator isn't going to be able to do anything with it once you get past this prolog error.

Rhett

I don't know if it has a problem with my XML or XSD schema, my XML schema is following:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="C:\files\modele.xsl"?>
<mod�le xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="C:\files\modele2.xsd">

�<exemple>
��<numero_semaine></numero_semaine>
��<professeur></professeur>
��<difficulte></difficulte>
��<nom_fichier></nom_fichier>
��<mots_Cl�s></mots_Cl�s>
��<titre_exemple></titre_exemple>
��
����<�nonc�>d�finition du probl�me</�nonc�>
���
����<r�solution>
���<�tape>
����<contenu></contenu>
����<expliquer></expliquer>
����<action></action>
����<objetDirect></objetDirect>
����<parametre></parametre>
���</�tape>
��</r�solution>
��
����! ;<conclusion>la solution de l'exemple</conclusion>
��
����<multimedia>
���<media>
����<type></type>
����<source></source>
���</media>
��</multimedia>
�</exemple>
</mod�le>

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev


Reply via email to