Hi Peter,

Thanks for this. Unless I'm mistaken, namespace URIs are not required to map
to any resource at all, let alone an XSD. However, the xsd from which I'm
generating the code is at
http://xmlgw.companieshouse.gov.uk/v2-1/schema/Egov_ch-v2-0.xsd.

What is PyXB expecting in its input that could be leading to this? Does it
rely on namespaces naming XSD files?

On Wed, Oct 19, 2011 at 16:49, Peter Bigot <big...@acm.org> wrote:

> On Wed, Oct 19, 2011 at 10:32 AM, Marcin Tustin 
> <marcin.tus...@gmail.com>wrote:
>
>> Hi all,
>>
>> I'm making my first contact with pyxb, and so far it seems to only exist
>> to generate odd errors.
>>
>> I've tried to have it parse a document with:
>>
>> > import govtalkenvelope as g
>> > g.CreateFromDocument("""[xml taken from
>> http://xmlgw.companieshouse.gov.uk/example_http.html]""";)
>> Traceback (most recent call last):
>>   File "<stdin>", line 35, in <module>
>>   File "govtalkenvelope.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 338, in
>> start_element_ns
>>     AttributesNSImpl(newattrs, qnames))
>>   File
>> "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\pyxb\binding\sax
>> er.py", line 310, in startElementNS
>>     element_binding = name_en.elementBinding()
>>   File
>> "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\pyxb\namespace\_
>> _init__.py", line 96, in __getattr__
>>     category_value =
>> self.namespace().categoryMap(name).get(self.localName())
>>   File
>> "C:\Users\Marcin\Documents\oneclickcos\lib\site-packages\pyxb\namespace\_
>> _init__.py", line 293, in categoryMap
>>     raise pyxb.NamespaceError(self, '%s has no category %s' % (self,
>> category))
>> pyxb.exceptions_.NamespaceError:
>> http://www.govtalk.gov.uk/schemas/govtalk/govta
>> lkheader has no category elementBinding
>>
>
> It's probably saying it doesn't know how to deal with the
> http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader namespace.
> Certainly it isn't clear to me where to find a schema for that namespace;
> the xsiLocation URI in the sample resolves to a web page, not a schema.
>
> Did you generate bindings for that namespace?  How?
>
>
>>
>> Needless to say, it's less than clear what this is supposed to mean. Any
>> suggestions as to what might be causing this, or indeed how in general to
>> deal with pyxb's exception messages?
>>
>
> Experience is the only guide.  Sorry, PyXB development is unfunded, so
> making it user friendly hasn't gotten much attention.
>
> Peter
>
>
>>
>> Marcin
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>>
>>
>> ------------------------------------------------------------------------------
>> All the data continuously generated in your IT infrastructure contains a
>> definitive record of customers, application performance, security
>> threats, fraudulent activity and more. Splunk takes this data and makes
>> sense of it. Business sense. IT sense. Common sense.
>> http://p.sf.net/sfu/splunk-d2d-oct
>> _______________________________________________
>> pyxb-users mailing list
>> pyxb-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pyxb-users
>>
>>
>


-- 
Marcin Tustin
Tel: 07773 787 105
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to