Justin,

Oops.  The output from xmllint in my previous message used a
slightly extended .xsd and .xml.

Here is the output from the two files I actually attached:

    $ xmllint --schema test01.xsd test01.xml
    <?xml version="1.0"?>
    <dog>
        <name>jasmine</name>
    </dog>
    test01.xml validates

Dave

On Tue, Oct 02, 2018 at 09:25:32AM -0400, Justin McManus wrote:
>    Hi,
>    Your generateDS library has been really useful to me, thanks. However, I
>    just found a blocking bug for my use case, and I checked sourceforge and
>    bitbucket and didn't find any public issue trackers that I could report it
>    on. I'll take a look at fixing it anyway, but I wanted to check if there's
>    a place to report this officially, and whether you're accepting pull
>    requests.
>    The issue was found in generateDS 2.29.24 from PyPi. The gist of it is
>    that complex subtypes are always assumed to be defined as substitution
>    groups, e.g. type "Dog" that extends an abstract type "Animal" will be
>    rendered as <Dog> instead of <Animal type="Dog">, which fails xsd
>    validation. Here's a minimal example:
>    example.xsd:
>    <?xml version="1.0"?>
>    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; version="1.0">
>    <xs:element name="SubType" type="SubType"></xs:element>
>    <xs:complexType name="AbstractBaseType" abstract="true"></xs:complexType>
>    <xs:complexType name="SubType">
>      <xs:complexContent>
>        <xs:extension base="AbstractBaseType"></xs:extension>
>      </xs:complexContent>
>    </xs:complexType>
>    </xs:schema>
>    $>  generateDS -o example.py ./example.xsd
>    $> python
>    >>> import sys, example
>    >>> example.SubType().export(sys.stdout, 0)
>    <SubType/>

-- 

Dave Kuhlman
http://www.davekuhlman.org


_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to