[ 
https://issues.apache.org/jira/browse/XERCESJ-1540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13153435#comment-13153435
 ] 

Mukul Gandhi commented on XERCESJ-1540:
---------------------------------------

First of all you seem to be tight coupling your bug report to WSDL + XSD 
combination, and not to XSD alone.

We can only verify bug reports relating to XSD that make use of only the XSD 
language in isolation (therefore, accepting any bugs for approval that reflects 
specific behavior of our XSD implementation that is dependent on a specific 
context [WSDL in this case] wouldn't be in our scope) as per rules of the XSD 
language while working with the Xerces product.

Therefore, while reporting a problem relating to XSD implementation of Xerces, 
please isolate your problem at XSD + Xerces level alone.

Having said this, I tried isolating your new WSDL + XSD source code into only 
the XSD + Xerces scope. Below are my findings to your current claim of a 
possible bug,

1) You don't make correct use of the <import> statement at XSD level (it may be 
right with WSDL + XSD combine, but I'm not sure of that just now; may be a WSDL 
system can make the association between your two schemas -- i.e one importing 
another, as you've currently specified, provided you specify other XSD syntaxes 
correctly).

You don't specify "schemaLocation" in <import>, so the parent schema cannot 
find schema components it is depending on from the imported schema. This would 
result in an XSD schema construction error, and further validation won't be 
possible.

2) I modified your current example to following,

<xs:schema targetNamespace="http://gov.uscourts.ao.pacts/chrono"; 
xmlns:tns="http://gov.uscourts.ao.pacts/chrono"; version="1.0" 
xmlns:ns2="http://chrono.beans.webservices.pacts.ao.uscourts.gov/jaws"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
    
        <xs:import schemaLocation="moreinfo.xsd" 
namespace="http://chrono.beans.webservices.pacts.ao.uscourts.gov/jaws"/>
    
        <xs:element name="getChrono" type="tns:getChrono"/>
    
        <xs:complexType name="getChrono">
            <xs:sequence>
               <xs:element form="qualified" minOccurs="0" name="username" 
type="xs:string"/>
               <xs:element form="qualified" minOccurs="0" name="password" 
type="xs:string"/>
               <xs:element ref="ns2:attempted"/>
               <xs:element minOccurs="0" ref="ns2:author"/>
           </xs:sequence>
       </xs:complexType>
   
</xs:schema>

moreinfo.xsd

<xs:schema 
targetNamespace="http://chrono.beans.webservices.pacts.ao.uscourts.gov/jaws"; 
version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema";>
   
   <xs:element name="attempted" type="xs:boolean"/>
   
   <xs:element name="author" type="xs:string"/>
   
</xs:schema> 

and also modified one of the java statement in my original test case as follows 
(which is needed to get the desired XSD complexType component),

XSComplexTypeDefinition cmplxTypeDefinition = 
(XSComplexTypeDefinition)xsModel.getTypeDefinition("getChrono", 
"http://gov.uscourts.ao.pacts/chrono";);

I again get the correct result, i.e four particles that you're reporting as two.

I therefore think, Xerces doesn't seem to have a bug as you've suspected to be 
there.

I would also suggest to revisit your WSDL + XSD combined design, and may be 
there would be an error in that part of your design.
                
> getParticle() method of XSComplexTypeDefinition, does not return element 
> references in a complex type
> -----------------------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1540
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1540
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema API
>    Affects Versions: 2.11.0
>         Environment: Windows 7, xercesImpl-2.11.0b.jar
>            Reporter: Deepti Garg
>             Fix For: 2.11.0
>
>         Attachments: Chrono1.wsdl, Chrono1.wsdl, 
> WebservicesBaseComplexTypeWrapper.java
>
>
> The element references of complex types in the XSD are not returned by the 
> method of the Xerces API, getPaticle(.
> <xs:complexType name="result">
>     <xs:sequence>
>      <xs:element form="qualified" minOccurs="0" name="username" 
> type="xs:string"/>
>      <xs:element form="qualified" minOccurs="0" name="password" 
> type="xs:string"/>
>      <xs:element ref="ns:name"/>
>      <xs:element minOccurs="0" ref="ns:author"/>
>     </xs:sequence>
>    </xs:complexType>
> Here for the complex type result, only username and password elements are 
> returned by the getParticle() method. Even if the element reference belongs 
> to the same namespace as the complex type, it is not returned by the 
> getParticle() method. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to