Poc.xsd is the modified xsd
Poc.xml is the example xml file

When I run pocsample.py

I see:

pydev debugger: starting
Traceback (most recent call last):
  File 
"C:\downloads\eclipse_indigo_3_7\eclipse\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydevd.py",
 line 1307, in <module>
    debugger.run(setup['file'], None, None)
  File 
"C:\downloads\eclipse_indigo_3_7\eclipse\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydevd.py",
 line 1060, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "C:\Users\hbl4152\workspace\python1\src\pocSample.py", line 6, in 
<module>
    pobObject = poc.CreateFromDocument(xml, location_base='poc.xml')
  File "C:\Users\hbl4152\workspace\python1\src\poc.py", line 32, in 
CreateFromDocument
    saxer.parse(StringIO.StringIO(xml_text))
  File "C:\Python27\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "C:\Python27\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 349, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "C:\Python27\lib\site-packages\pyxb\binding\saxer.py", line 374, in 
endElementNS
    binding_object = this_state.endBindingElement()
  File "C:\Python27\lib\site-packages\pyxb\binding\saxer.py", line 232, in 
endBindingElement
    self.__bindingInstance.validateBinding()
  File "C:\Python27\lib\site-packages\pyxb\binding\basis.py", line 422, in 
validateBinding
    self._validateBinding_vx()
  File "C:\Python27\lib\site-packages\pyxb\binding\basis.py", line 1836, in 
_validateBinding_vx
    raise pyxb.BindingValidationError('Error matching content to binding model: 
%s' % (e,))
pyxb.exceptions_.BindingValidationError: Error matching content to binding 
model: Ungenerated symbols: {<pyxb.binding.content.ElementUse object at 
0x02D54E10>: [u'Want this for the holidays!']}

this is due ( In my opinion, to the choice entry for Items, it allows USPrice 
or comment )
            <xsd:choice>
                <xsd:element name="USPrice" type="xsd:decimal" minOccurs="0"/>
                <xsd:element ref="po:comment" minOccurs="0"/>
            </xsd:choice>

My example poc.xml has a USPrice for one Item but comment for the other Item.

Assistance would be appreciated.

Bill Riegel
Landmark Graphics Corp.
713-839-3388

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to