I just tried using 0.9.5 and because of the new creation of Sequence,
Choice, SequenceItem, ChoiceItem and their respective descriptors I no
longer have this issue. So please don't look into anymore unless the
binding-file locationpath was easy to explain...

Elias

-----Original Message-----
From: Elias Torres [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 05, 2003 1:59 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] binding-xml location path for resolving conflicts
involving attributes from attributeGroups used in ComplexTypes



I hope someone could clarify what I could possible be doing wrong or maybe
it's not supported, although I have to say I'm very impressed of how much
does castor support and the cleanliness in which it does its job.

I'm trying to use the Castor SourceGenerator on a schema that has both an
element and attribute with the same name and as expected I'm encountering
the 'duplicate name found' exception in the process. I'm trying to come up
with a binding-file that could resolve this conflict to no avail. Anybody
can suggest any LocationPaths that I have not tried in binding-file below?
it would be greatly appreciated. 

I did read this post from Bruce, but I'm not really sure if that's to solve
the same problem.

http://marc.theaimsgroup.com/?l=castor-dev&m=104661302917619&w=2

Below are the files I'm using with the following command-line options:

-i src/experiments/test.xsd -types j2 -dest src/experiments -package
com.example.test -f -binding-file src/experiments/binding.xml

Regards,

Elias

schema file:
---------------------------------
<?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema elementFormDefault="qualified" 
                xmlns="http://www.example.com"; 
                targetNamespace="http://www.example.com"; 
                version="1.0" 
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
                xmlns:tns="http://www.example.com";>
        
        <xsd:complexType name="aComplexType">
                <xsd:sequence>
                        <xsd:element maxOccurs="1" minOccurs="0"
name="anElement">
                                <xsd:complexType>
                                        <xsd:sequence>
                                                <xsd:sequence
maxOccurs="unbounded" minOccurs="0">
                                                        <xsd:element
maxOccurs="unbounded" 
        
minOccurs="0" 
        
name="status" 
        
type="xsd:anyURI"/>
                                                </xsd:sequence>
                                        </xsd:sequence>
                                        <xsd:attributeGroup
ref="anAttributeGroup"/>
                                </xsd:complexType>
                        </xsd:element>
                </xsd:sequence>
        </xsd:complexType>
        
        <xsd:attributeGroup name="anAttributeGroup">
                <xsd:attribute name="status" 
                        type="xsd:anyURI" 
                        use="required" />
        </xsd:attributeGroup>   
    
</xsd:schema>
---------------------------------
and this binding file:
---------------------------------
<?xml version="1.0"?>
<!-- This file contains the binding information -->
<!-- for the invoice XML Schema -->
<!-- It is meant to be used by the Castor Source Code Generator -->

<cbf:binding xmlns:cbf="http://www.castor.org/SourceGenerator/Binding";
             defaultBindingType='element'>
     
        <cbf:elementBinding
name="complexType:aComplexType/anElement/status">
                <cbf:member name="MyStatus" type="string"/>
        </cbf:elementBinding>
   
        <cbf:attributeBinding name="group:anAttributeGroup/@status">
                <cbf:member name="attributeGroupStatus" type="string" />

        </cbf:attributeBinding>

        <cbf:attributeBinding 
        
name="complexType:aComplexType/anElement/group:anAttributeGroup/@status">
                <cbf:member name="attributeGroupStatus" type="string" />

        </cbf:attributeBinding>

        <cbf:attributeBinding
name="complexType:aComplexType/anElement/@status">
                <cbf:member name="attributeGroupStatus" type="string" />

        </cbf:attributeBinding>         
</cbf:binding>
---------------------------------

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

Reply via email to