Hi Werner,

The problem was that, there is a "cacheIncludedSchema" boolean flag in those 2 
files "SchemaReader.java" and "SchemaUnmarshallerState.java".   The default 
value is false.
When the parent.xsd (main input) (which contains references to child.xsd, using 
xsd:include), is used to generate the Castor code (for unmarshalling and 
marshalling of xml instances), it generates code for both child.xsd and 
parent.xsd in the same package, eventhough i had specified that those are 
destined for 2 different packages (based on schemaLocation).    When I changed 
that flag to "true", then it generates the code in their respective packages 
based on the values in the binding.xml (package and schemaLocation).

Checking on the castorbuilder properties file, I could not find anything to 
turn on that flag.  Hence, that is a change requested to set it from the 
property file, instead of needing a code change.  Hope you will be able to make 
arrangements to fix it in the future release.

Thanks
Kannan

-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 16, 2007 4:21 AM
To: [email protected]
Subject: Re: [castor-user] SchemaLocation based package generation using
Castor (source generator) binding.xsd is not working


Well, great to see you've got it working. But I am not sure whether I 
understand your problem resolution fully. Mind explaining things in more 
detail, pretty pleasse ?

Werner

Jayaraman, Kannan wrote:
> Hi Werner, The problem I found was with the "cacheIncludedSchema"
> boolean flag in "SchemaReader.java" and
> "SchemaUnmarshallerState.java", files was set to a default value of
> "false".  Once I set it to "true", then I am seeing the package based
> generation ( based on schemaLocation specified in binding file), for
> schemas with "xsd:include" in the parent schema.
> 
> Thanks Kannan
> 
> -----Original Message----- From: Werner Guttmann
> [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007
> 2:56 AM To: [email protected] Subject: Re: [castor-user]
> SchemaLocation based package generation using Castor (source
> generator) binding.xsd is not working
> 
> 
> Hi,
> 
> you will have to use an absolute path in the <schemaLocation> element
> of your binding file for this to work.
> 
> Werner
> 
> Jayaraman, Kannan wrote:
>> I have the following 2 xsd's (which I wish to generate in their own
>>  packages, using castor custom binding xml, based on binding.xsd ).
>>  However, I have no luck in generating them in separate packages. I
>> can however do so, if I drive it by namespace. Pls, help me, with
>> what I'm doing wrong. Here are the 2 xsd's, and the binding.xml. 
>> Thanks Kannan 1. parent.xsd <?xml version="1.0" encoding="UTF-8"?> 
>> <xs:schema xmlns="http://www.castor.org/parent"; 
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
>> elementFormDefault="qualified" 
>> targetNamespace="http://www.castor.org/parent"; 
>> attributeFormDefault="unqualified"> <xs:include
>> schemaLocation="child.xsd"/> <xs:element name="Parent"> 
>> <xs:complexType> <xs:sequence> <xs:element ref="Child"/> 
>> <xs:element name="parentDate" type="xs:dateTime" minOccurs="0"/> 
>> <xs:element name="parentName" type="xs:string"/> </xs:sequence> 
>> </xs:complexType> </xs:element> 2. child.xsd <?xml version="1.0"
>> encoding="UTF-8"?> <xs:schema 
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
>> elementFormDefault="qualified" attributeFormDefault="unqualified"> 
>> <xs:element name="Child"> <xs:complexType> <xs:sequence> 
>> <xs:element name="childDate" type="xs:dateTime" minOccurs="0"/> 
>> <xs:element name="childName" type="xs:string"/> </xs:sequence> 
>> </xs:complexType> </xs:element> </xs:schema> 3. binding2.xml <?xml
>> version="1.0" encoding="UTF-8"?> <p:binding
>> defaultBindingType="element" xmlns 
>> ole0.bmp="http://www.castor.org/SourceGenerator/Binding"; 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
>> xsi:schemaLocation="http://www.castor.org/SourceGenerator/Binding 
>> binding.xsd"> <p:package> <p:name><![CDATA[com.test]]></p:name> 
>> <p:schemaLocation><![CDATA[parent.xsd]]></p:schemaLocation> 
>> </p:package> <p:package> 
>> <p:name><![CDATA[com.test.child]]></p:name> 
>> <p:schemaLocation><![CDATA[child.xsd]]></p:schemaLocation> 
>> </p:package> </p:binding> 4. Command Line java
>> org.exolab.castor.builder.SourceGeneratorMain -i parent.xsd 
>> -binding-file binding2.xml <<binding2.xml>> <<parent.xsd>>
>> <<child.xsd>>
>> 
>> Please help  !!! Thanks Kannan
>> 
>> 
>> 
>> ------------------------------------------------------------------------
>> 
>> 
>> ---------------------------------------------------------------------
>>  To unsubscribe from this list please visit:
>> 
>> http://xircles.codehaus.org/manage_email
> 
> 
> ---------------------------------------------------------------------
>  To unsubscribe from this list please visit:
> 
> http://xircles.codehaus.org/manage_email
> 
> 
> ---------------------------------------------------------------------
>  To unsubscribe from this list please visit:
> 
> http://xircles.codehaus.org/manage_email
> 
> 


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to