Hi, Daniel,

I have committed another patch to 0.4 and HEAD, which should fix the
problem below. The reason was, that the outer schemas system ID wasn't
remembered.

A unit test is available, see the method
  ParserTest.testRecursiveXsInclude()


Jochen


Daniel Barclay wrote:
> Jochen Wiedmann wrote:
> 
>>> It seems JaxMeXS can't handle schema files that recursively include
>>> each other (e.g., A.xsd includes B.xsd, B.xsd includes A.xsd).
>>
>>
>>
>> You are right. The check was implemented for xs:import, but not for
>> xs:include. Fixed in the 0.4 branch and in HEAD.
> 
> 
> Does the fix just prevent the endless recursion, or does it also handle
> inclusion correctly?
> 
> I tried manually back-porting the changes to 0.3.1.  When I ran my
> original test case, it did prevent endless recursion.
> 
> However, when I add a declaration to _one_ of the schema files, I get
> an error about duplicate definitions.
> 
> Specifically, when I add a declaration to file at which parsing
> starts, I get the error.  When I add the declaration to a file
> that is reached only by inclusion, I don't get the error.
> 
> - A.xsd includes B.xsd
> - B.xsd includes A.xsd
> - A.xsd defines an element E
> - starting parsing at A.xsd yields an error about E being a duplicate
> - starting parsing at B.xsd does not yield such an error
> 
> Assuming I didn't back-port the change wrong, it seems that the
> parser forgets to include the starting file in the set of files
> for which it should skip includes (because they have already been
> read).
> 
> 
> 
> Here is a pair of test files:
> 
> -----------------------------------------------------------------------
> RecursiveIndirectly1.xsd_
> ----------
> <xsd:schema
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>   >
>   <xsd:include schemaLocation="RecursiveIndirectly2.xsd" />
>     
>   <xsd:element name="In1"/>
> 
> </xsd:schema>
> -----------------------------------------------------------------------
> RecursiveIndirectly2.xsd:
> ----------
> <xsd:schema
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>   >
>   <xsd:include schemaLocation="RecursiveIndirectly1.xsd" />
> 
>   <!--xsd:element name="In2"/-->
> 
> </xsd:schema>
> --------------------------------------------------------------------
> 
> 
> Daniel
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to