Bob,

Thanks for this report.  I have not had time to look at this one
yet, but just today I've been working on an issue that seems
similar.  I won't know whether they're related until I've looked at
your schema.

Give me a day or two to snoop.

Dave

On Mon, Oct 23, 2017 at 05:07:20PM -0700, Bob Barcklay wrote:
>    Hi,
>    I am using generateDS to parse an XML Signature.  When I attempt to parse
>    the signature XML, I encounter an error in a buildChildren method:
>    $ python xmldsig.py sig.xml
>    Traceback (most recent call last):
>      File "xmldsig.py", line 3511, in <module>
>        main()
>      File "xmldsig.py", line 3504, in main
>        parse(args[0])
>      File "xmldsig.py", line 3420, in parse
>        rootObj.build(rootNode)
>      File "xmldsig.py", line 796, in build
>        self.buildChildren(child, node, nodeName_)
>      File "xmldsig.py", line 816, in buildChildren
>        obj_.build(child_)
>      File "xmldsig.py", line 1845, in build
>        self.buildChildren(child, node, nodeName_)
>      File "xmldsig.py", line 1879, in buildChildren
>        obj_ = X509Data.factory()
>    NameError: name 'X509Data' is not defined
>    It appears that the generated code is using the element name
>    (â**X509Dataâ**) when it should be using the type/class name
>    (â**X509DataTypeâ**).  If I regenerate the code with this switch:
>    $generateDS â**fix-type-names â**X509DataType:X509Dataâ** xmldsig.xsd
>    It parses correctly. The schema is here:
>     
> https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd 
> and
>    the relevant bits are:
>    <complexType name="KeyInfoType" mixed="true">
>    <choice maxOccurs="unbounded">
>    ...
>    <element ref="ds:X509Data"/>
>    ...
>    <any processContents="lax" namespace="##other"/>
>    <!-- (1,1) elements from (0,unbounded) namespaces -->
>    </choice>
>    <attribute name="Id" type="ID" use="optional"/>
>    </complexType>
>    ...
>    <!-- Start X509Data -->
>    <element name="X509Data" type="ds:X509DataType"/>
>    <complexType name="X509DataType">
>    <sequence maxOccurs="unbounded">
>    <choice>
>    ...
>    </choice>
>    </sequence>
>    </complexType>
>    I donâ**t understand why the generated code is calling X509Data.factory()
>    instead of X509DataType.factory().  X509DataType is the name of the class
>    in the generated py file.
>    Is this a bug or is there something unusual in the XSD that causes this?
>     Is the â**fix-type-names switch a proper work around?
>    Thanks in advance for any help.
>    -Bob

> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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


-- 

Dave Kuhlman
http://www.davekuhlman.org

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to