Hi,
I sent the email below few days ago and I did not get any reply. I Really
appreciate your help to figure out the error I am getting.
Thanks.
Malika
---------- Forwarded message ----------
From: malika mahoui <mamah...@gmail.com>
Date: Mon, Feb 9, 2015 at 9:13 AM
Subject: pyxb issues with assigning values to anunbound inner complex
element with known type
To: pyxb-users@lists.sourceforge.net
I am trying to assign values to an unbound inner element of a predefined
type but I am not able to validate it.
here is my example with reports.xsd and the snippet of the code that is
not working:
...
<xs:element name="reports" type="tns:Reports"/>
<xs:complexType name="Reports">
<xs:sequence>
<xs:element minOccurs="0" name="description" type="xs:string"/>
<xs:element minOccurs="0" name="reportingGroups">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0"
name="reportingGroup"
type="tns:ReportingGroupType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ReportingGroupType">
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element minOccurs="0" name="description" type="xs:string"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required"/>
</xs:complexType>
-------------------------------------------------------
import reports
rep=reports.reports()
rep.description="this report is ..." #works
rep.reportingGroups=pyxb.BIND()
rep.reportingGroups.append("ReportingGroupType(name='this
title",id=xs.string("A1")) #works
print(rep.reportingGroups.toxml("utf-8")) #does not work
-------------------------------------
I was not able to find a case similar to this one. I appreciate your help.
Malika
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users