-----Original Message-----
From: Jayaraman, Kannan [GCG-NAOT] 
Sent: Tuesday, October 09, 2007 1:59 PM
To: [EMAIL PROTECTED]
Subject: [castor-user] SchemaLocation based package generation using Castor 
(source generator) binding.xsd is not working



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 


<<ole0.bmp>>

<?xml version="1.0" encoding="UTF-8"?>
<p:binding defaultBindingType="element" xmlns:p="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>

Attachment: parent.xsd
Description: parent.xsd

Attachment: child.xsd
Description: child.xsd

---------------------------------------------------------------------
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