Thank you. I am using stackoverflow reply to fix my problem.
Malika
On Thu, Feb 12, 2015 at 12:59 PM, Peter Bigot <big...@acm.org> wrote:
> See
> http://pyxb.sourceforge.net/api/pyxb.binding.basis._TypeBinding_mixin-class.html#_setIsNil
>
> and various examples in the PyXB tests directory.
>
> Please accept the answer I gave to your stack overflow question and ask
> future questions in public forums (stack overflow, the mailing list, or
> github issues) so others can benefit from the information.
>
> Peter
>
> On Thu, Feb 12, 2015 at 11:28 AM, malika mahoui <mamah...@gmail.com>
> wrote:
>
>> Hi Peter,
>> after going through the reply to my question on stackoverflow, I went to
>> my full example and I found out that my real problem was that I was not
>> assigning a value to an element that was nillable (see description
>> element below)
>>
>> <xs:element name="reports" type="tns:Reports"/>
>>
>> <xs:complexType name="Reports">
>>
>> <xs:sequence> ...
>>
>> <xs:element name="nbReports" nillable="true" type="xs:int"/>
>>
>> So, I tried to assign xs.int() to description but this will create <
>> nbReports>0</nbReports)>while in my case I want <nbReports xs:nil=true/>
>>
>> thanks.
>>
>>
>> Malika
>>
>> On Thu, Feb 12, 2015 at 9:11 AM, malika mahoui <mamah...@gmail.com>
>> wrote:
>>
>>> Hi Peter,
>>> thank you for forwarding me to the reply.
>>> Malika
>>>
>>> On Wed, Feb 11, 2015 at 1:34 PM, Peter Bigot <big...@acm.org> wrote:
>>>
>>>> Answered [on stackoverflow](stackoverflow.com/questions/28372382).
>>>>
>>>> Peter
>>>>
>>>> On Wed, Feb 11, 2015 at 9:22 AM, malika mahoui <mamah...@gmail.com>
>>>> wrote:
>>>>
>>>>> 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
>>>>>
>>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
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