pyxb-users Mailing List for PyXB: Python XML Schema Bindings (Page 3)
Brought to you by:
pabigot
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(11) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(17) |
Feb
(3) |
Mar
|
Apr
|
May
(7) |
Jun
(1) |
Jul
(7) |
Aug
(3) |
Sep
|
Oct
(7) |
Nov
(4) |
Dec
(2) |
2011 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(14) |
Nov
|
Dec
|
2012 |
Jan
(8) |
Feb
(7) |
Mar
(5) |
Apr
(5) |
May
(16) |
Jun
(5) |
Jul
(3) |
Aug
(2) |
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2013 |
Jan
(4) |
Feb
(9) |
Mar
(8) |
Apr
(5) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(5) |
Oct
(9) |
Nov
(2) |
Dec
|
2014 |
Jan
|
Feb
(19) |
Mar
(4) |
Apr
(3) |
May
(3) |
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
(3) |
Nov
|
Dec
(3) |
2015 |
Jan
|
Feb
(3) |
Mar
(1) |
Apr
(10) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Peter B. <bi...@ac...> - 2014-02-21 21:14:08
|
You can't create an element for which there isn't a schema, except that PyXB will treat DOM elements as wildcards which can be appended to an xsd.anyType() instance instead of appending instances of an element derived from some other schema. If you use the oseo bindings to parse that example document into a Python instance, you'll see the raw DOM instances as the content of the values element. Normally you'd have schema for a namespace that is appropriate for your application, and use those in something like: pd.values = xsd.anyType() pd.values.append(ds.processingLevel('1B')) pd.values.append(ds.productType('ASA_IMS_1P')) pd.values.append(ds.qualityOfService('STANDARD')) AFAICT there is no schema for those samples ( http://www.opengis.net/oseo/1.0/dataset is not the same namespace as oseo uses), so there is no ds module to use this way. While it's probably possible to create the DOM content manually, it's not easy to do it in a way that has the internal hints that lets PyXB generate documents with the necessary namespace declarations (I just spent an hour on it and am giving it up as not worth the time; sorry). Peter On Fri, Feb 21, 2014 at 8:57 AM, Ricardo Filipe Soares Garcia da < ric...@gm...> wrote: > Hi again > > >> >> >> http://schemas.opengis.net/SCHEMAS_OPENGIS_NET.tgz includes, along with >> the schemas, some sample documents for oseo. Those might help in figuring >> out what should be assigned to the values. >> >> > Yes, I am trying to reproduce the following snippet, which comes from a > sample document of the oseo standard (GetStatusResponse.xml): > > <option> > <ParameterData> > <encoding>XMLEncoding</encoding> > <values xmlns:ns="http://www.opengis.net/oseo/1.0/dataset"> > <ns:processingLevel>1B</ns:processingLevel> > <ns:productType>ASA_IMS_1P</ns:productType> > <ns:qualityOfService>STANDARD</ns:qualityOfService> > </values> > </ParameterData> > </option> > > How can I create the processingLevel element? It seems I must create a > complexType element with its own name. Sadly, I cannot figure out how to do > it ;) > > These elements are not defined in the oseo schema, so I am not sure how > I'd go about creating them. I've tried several combinations involving > pyxb.binding.basis.element, but after trying so many different stuff I am > not so sure of what I am doing at this point. > > Thanks a lot for your (continued) help. > > > Peter >> >> >> On Thu, Feb 20, 2014 at 6:34 PM, Ricardo Filipe Soares Garcia da < >> ric...@gm...> wrote: >> >>> Hi Peter >>> >>> I got it working now, thanks for your help! >>> >>> Now I am failing at building an oseo.ParameterData. I can't seem to >>> create the 'values' element, which should be an AnyType element. I am still >>> a beginner with these things so maybe this is something obvious... >>> >>> By the way, I am following the oseo specification section 7.3.9 >>> ParameterData, Figure 7-12, if it is relevant >>> >>> # Python code >>> import pyxb >>> import pyxb.bundles.opengis.oseo as oseo >>> pd = oseo.ParameterData() >>> pd.encoding = 'TextEncoding' >>> pd.values = pyxb.BIND() >>> pd.values.name = 'test option' >>> pd.values = 'test value' >>> pd.toxml() >>> >>> ...AttributeError: 'str' object has no attribute 'toDOM' >>> >>> Am I adding the 'name' attribute correctly? How can I set the 'values' >>> element? >>> >>> Thanks in advance >>> >>> >>> >>> On Thu, Feb 20, 2014 at 3:12 PM, Peter Bigot <bi...@ac...> wrote: >>> >>>> You need to create the instance using an element, not the underlying >>>> type, so PyXB can tell what string to put in the start and end tags of the >>>> XML. >>>> >>>> See >>>> https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/#e804and any or all of these three threads for more information: >>>> >>>> https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/ >>>> https://sourceforge.net/p/pyxb/discussion/956708/thread/fe705025/ >>>> https://sourceforge.net/p/pyxb/discussion/956708/thread/5d5e0320/ >>>> >>>> Peter >>>> >>>> >>>> >>>> On Thu, Feb 20, 2014 at 9:05 AM, Ricardo Filipe Soares Garcia da < >>>> ric...@gm...> wrote: >>>> >>>>> Hi list >>>>> >>>>> I am trying to use a pyxb.bundles.opengis.oseo.DeliveryInformationType >>>>> but keep getting an error. I want to create the element, fill it with >>>>> values and then get its XML representation. >>>>> >>>>> # Python code >>>>> import pyxb.bundles.opengis.oseo as oseo >>>>> dit = oseo.DeliveryInformationType() >>>>> dit.mailAddress = oseo.DeliveryAddressType(firstName='Ricardo') >>>>> dit.toxml() >>>>> >>>>> UnboundElementError: Instance of type { >>>>> http://www.opengis.net/oseo/1.0}DeliveryInformationType has no bound >>>>> element for start tag >>>>> >>>>> I'm using pyxb version 1.2.3 downloaded from pypi >>>>> >>>>> How can I overcome this issue? >>>>> >>>>> Thanks in advance >>>>> >>>>> -- >>>>> ___________________________ ___ __ >>>>> Ricardo Garcia Silva >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Managing the Performance of Cloud-Based Applications >>>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>>>> Read the Whitepaper. >>>>> >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> pyxb-users mailing list >>>>> pyx...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/pyxb-users >>>>> >>>>> >>>> >>> >>> >>> -- >>> ___________________________ ___ __ >>> Ricardo Garcia Silva >>> >>> >>> ------------------------------------------------------------------------------ >>> Managing the Performance of Cloud-Based Applications >>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>> Read the Whitepaper. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> pyxb-users mailing list >>> pyx...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyxb-users >>> >>> >> > > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > > |
From: Ricardo F. S. G. da <ric...@gm...> - 2014-02-21 14:58:07
|
Hi again > > > http://schemas.opengis.net/SCHEMAS_OPENGIS_NET.tgz includes, along with > the schemas, some sample documents for oseo. Those might help in figuring > out what should be assigned to the values. > > Yes, I am trying to reproduce the following snippet, which comes from a sample document of the oseo standard (GetStatusResponse.xml): <option> <ParameterData> <encoding>XMLEncoding</encoding> <values xmlns:ns="http://www.opengis.net/oseo/1.0/dataset"> <ns:processingLevel>1B</ns:processingLevel> <ns:productType>ASA_IMS_1P</ns:productType> <ns:qualityOfService>STANDARD</ns:qualityOfService> </values> </ParameterData> </option> How can I create the processingLevel element? It seems I must create a complexType element with its own name. Sadly, I cannot figure out how to do it ;) These elements are not defined in the oseo schema, so I am not sure how I'd go about creating them. I've tried several combinations involving pyxb.binding.basis.element, but after trying so many different stuff I am not so sure of what I am doing at this point. Thanks a lot for your (continued) help. Peter > > > On Thu, Feb 20, 2014 at 6:34 PM, Ricardo Filipe Soares Garcia da < > ric...@gm...> wrote: > >> Hi Peter >> >> I got it working now, thanks for your help! >> >> Now I am failing at building an oseo.ParameterData. I can't seem to >> create the 'values' element, which should be an AnyType element. I am still >> a beginner with these things so maybe this is something obvious... >> >> By the way, I am following the oseo specification section 7.3.9 >> ParameterData, Figure 7-12, if it is relevant >> >> # Python code >> import pyxb >> import pyxb.bundles.opengis.oseo as oseo >> pd = oseo.ParameterData() >> pd.encoding = 'TextEncoding' >> pd.values = pyxb.BIND() >> pd.values.name = 'test option' >> pd.values = 'test value' >> pd.toxml() >> >> ...AttributeError: 'str' object has no attribute 'toDOM' >> >> Am I adding the 'name' attribute correctly? How can I set the 'values' >> element? >> >> Thanks in advance >> >> >> >> On Thu, Feb 20, 2014 at 3:12 PM, Peter Bigot <bi...@ac...> wrote: >> >>> You need to create the instance using an element, not the underlying >>> type, so PyXB can tell what string to put in the start and end tags of the >>> XML. >>> >>> See >>> https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/#e804and any or all of these three threads for more information: >>> >>> https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/ >>> https://sourceforge.net/p/pyxb/discussion/956708/thread/fe705025/ >>> https://sourceforge.net/p/pyxb/discussion/956708/thread/5d5e0320/ >>> >>> Peter >>> >>> >>> >>> On Thu, Feb 20, 2014 at 9:05 AM, Ricardo Filipe Soares Garcia da < >>> ric...@gm...> wrote: >>> >>>> Hi list >>>> >>>> I am trying to use a pyxb.bundles.opengis.oseo.DeliveryInformationType >>>> but keep getting an error. I want to create the element, fill it with >>>> values and then get its XML representation. >>>> >>>> # Python code >>>> import pyxb.bundles.opengis.oseo as oseo >>>> dit = oseo.DeliveryInformationType() >>>> dit.mailAddress = oseo.DeliveryAddressType(firstName='Ricardo') >>>> dit.toxml() >>>> >>>> UnboundElementError: Instance of type { >>>> http://www.opengis.net/oseo/1.0}DeliveryInformationType has no bound >>>> element for start tag >>>> >>>> I'm using pyxb version 1.2.3 downloaded from pypi >>>> >>>> How can I overcome this issue? >>>> >>>> Thanks in advance >>>> >>>> -- >>>> ___________________________ ___ __ >>>> Ricardo Garcia Silva >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Managing the Performance of Cloud-Based Applications >>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>>> Read the Whitepaper. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> pyxb-users mailing list >>>> pyx...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyxb-users >>>> >>>> >>> >> >> >> -- >> ___________________________ ___ __ >> Ricardo Garcia Silva >> >> >> ------------------------------------------------------------------------------ >> Managing the Performance of Cloud-Based Applications >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >> Read the Whitepaper. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk >> _______________________________________________ >> pyxb-users mailing list >> pyx...@li... >> https://lists.sourceforge.net/lists/listinfo/pyxb-users >> >> > -- ___________________________ ___ __ Ricardo Garcia Silva |
From: Peter B. <bi...@ac...> - 2014-02-21 02:23:44
|
xs:anyType just means that the values element is compatible with any type at all. It does, though, have to be a type that inherits from pyxb.binding.basis._TypeBinding_mixin, i.e. a type that was defined from an XML complexType or simpleType. A simple example: import pyxb.bundles.opengis.oseo_1_0 as oseo import pyxb.binding.datatypes as xs pd = oseo.ParameterData(encoding='TextEncoding') pd.values = xs.string("test data") pd.toxml('utf-8') Presumably instead of xsd.string() you want some complexType that has a name attribute; I don't know anything about oseo so can't guess what you should use. (I'd expect, though, in that case you would need to use XmlEncoding instead of TextEncoding.) http://schemas.opengis.net/SCHEMAS_OPENGIS_NET.tgz includes, along with the schemas, some sample documents for oseo. Those might help in figuring out what should be assigned to the values. Peter On Thu, Feb 20, 2014 at 6:34 PM, Ricardo Filipe Soares Garcia da < ric...@gm...> wrote: > Hi Peter > > I got it working now, thanks for your help! > > Now I am failing at building an oseo.ParameterData. I can't seem to create > the 'values' element, which should be an AnyType element. I am still a > beginner with these things so maybe this is something obvious... > > By the way, I am following the oseo specification section 7.3.9 > ParameterData, Figure 7-12, if it is relevant > > # Python code > import pyxb > import pyxb.bundles.opengis.oseo as oseo > pd = oseo.ParameterData() > pd.encoding = 'TextEncoding' > pd.values = pyxb.BIND() > pd.values.name = 'test option' > pd.values = 'test value' > pd.toxml() > > ...AttributeError: 'str' object has no attribute 'toDOM' > > Am I adding the 'name' attribute correctly? How can I set the 'values' > element? > > Thanks in advance > > > > On Thu, Feb 20, 2014 at 3:12 PM, Peter Bigot <bi...@ac...> wrote: > >> You need to create the instance using an element, not the underlying >> type, so PyXB can tell what string to put in the start and end tags of the >> XML. >> >> See >> https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/#e804and any or all of these three threads for more information: >> >> https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/ >> https://sourceforge.net/p/pyxb/discussion/956708/thread/fe705025/ >> https://sourceforge.net/p/pyxb/discussion/956708/thread/5d5e0320/ >> >> Peter >> >> >> >> On Thu, Feb 20, 2014 at 9:05 AM, Ricardo Filipe Soares Garcia da < >> ric...@gm...> wrote: >> >>> Hi list >>> >>> I am trying to use a pyxb.bundles.opengis.oseo.DeliveryInformationType >>> but keep getting an error. I want to create the element, fill it with >>> values and then get its XML representation. >>> >>> # Python code >>> import pyxb.bundles.opengis.oseo as oseo >>> dit = oseo.DeliveryInformationType() >>> dit.mailAddress = oseo.DeliveryAddressType(firstName='Ricardo') >>> dit.toxml() >>> >>> UnboundElementError: Instance of type { >>> http://www.opengis.net/oseo/1.0}DeliveryInformationType has no bound >>> element for start tag >>> >>> I'm using pyxb version 1.2.3 downloaded from pypi >>> >>> How can I overcome this issue? >>> >>> Thanks in advance >>> >>> -- >>> ___________________________ ___ __ >>> Ricardo Garcia Silva >>> >>> >>> ------------------------------------------------------------------------------ >>> Managing the Performance of Cloud-Based Applications >>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >>> Read the Whitepaper. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> pyxb-users mailing list >>> pyx...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyxb-users >>> >>> >> > > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > > |
From: Ricardo F. S. G. da <ric...@gm...> - 2014-02-21 00:34:33
|
Hi Peter I got it working now, thanks for your help! Now I am failing at building an oseo.ParameterData. I can't seem to create the 'values' element, which should be an AnyType element. I am still a beginner with these things so maybe this is something obvious... By the way, I am following the oseo specification section 7.3.9 ParameterData, Figure 7-12, if it is relevant # Python code import pyxb import pyxb.bundles.opengis.oseo as oseo pd = oseo.ParameterData() pd.encoding = 'TextEncoding' pd.values = pyxb.BIND() pd.values.name = 'test option' pd.values = 'test value' pd.toxml() ...AttributeError: 'str' object has no attribute 'toDOM' Am I adding the 'name' attribute correctly? How can I set the 'values' element? Thanks in advance On Thu, Feb 20, 2014 at 3:12 PM, Peter Bigot <bi...@ac...> wrote: > You need to create the instance using an element, not the underlying type, > so PyXB can tell what string to put in the start and end tags of the XML. > > See https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/#e804and any or all of these three threads for more information: > > https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/ > https://sourceforge.net/p/pyxb/discussion/956708/thread/fe705025/ > https://sourceforge.net/p/pyxb/discussion/956708/thread/5d5e0320/ > > Peter > > > > On Thu, Feb 20, 2014 at 9:05 AM, Ricardo Filipe Soares Garcia da < > ric...@gm...> wrote: > >> Hi list >> >> I am trying to use a pyxb.bundles.opengis.oseo.DeliveryInformationType >> but keep getting an error. I want to create the element, fill it with >> values and then get its XML representation. >> >> # Python code >> import pyxb.bundles.opengis.oseo as oseo >> dit = oseo.DeliveryInformationType() >> dit.mailAddress = oseo.DeliveryAddressType(firstName='Ricardo') >> dit.toxml() >> >> UnboundElementError: Instance of type { >> http://www.opengis.net/oseo/1.0}DeliveryInformationType has no bound >> element for start tag >> >> I'm using pyxb version 1.2.3 downloaded from pypi >> >> How can I overcome this issue? >> >> Thanks in advance >> >> -- >> ___________________________ ___ __ >> Ricardo Garcia Silva >> >> >> ------------------------------------------------------------------------------ >> Managing the Performance of Cloud-Based Applications >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. >> Read the Whitepaper. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk >> _______________________________________________ >> pyxb-users mailing list >> pyx...@li... >> https://lists.sourceforge.net/lists/listinfo/pyxb-users >> >> > -- ___________________________ ___ __ Ricardo Garcia Silva |
From: Peter B. <bi...@ac...> - 2014-02-20 15:12:26
|
You need to create the instance using an element, not the underlying type, so PyXB can tell what string to put in the start and end tags of the XML. See https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/#e804and any or all of these three threads for more information: https://sourceforge.net/p/pyxb/discussion/956708/thread/1204a2fa/ https://sourceforge.net/p/pyxb/discussion/956708/thread/fe705025/ https://sourceforge.net/p/pyxb/discussion/956708/thread/5d5e0320/ Peter On Thu, Feb 20, 2014 at 9:05 AM, Ricardo Filipe Soares Garcia da < ric...@gm...> wrote: > Hi list > > I am trying to use a pyxb.bundles.opengis.oseo.DeliveryInformationType > but keep getting an error. I want to create the element, fill it with > values and then get its XML representation. > > # Python code > import pyxb.bundles.opengis.oseo as oseo > dit = oseo.DeliveryInformationType() > dit.mailAddress = oseo.DeliveryAddressType(firstName='Ricardo') > dit.toxml() > > UnboundElementError: Instance of type { > http://www.opengis.net/oseo/1.0}DeliveryInformationType has no bound > element for start tag > > I'm using pyxb version 1.2.3 downloaded from pypi > > How can I overcome this issue? > > Thanks in advance > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > > |
From: Ricardo F. S. G. da <ric...@gm...> - 2014-02-20 15:06:08
|
Hi list I am trying to use a pyxb.bundles.opengis.oseo.DeliveryInformationType but keep getting an error. I want to create the element, fill it with values and then get its XML representation. # Python code import pyxb.bundles.opengis.oseo as oseo dit = oseo.DeliveryInformationType() dit.mailAddress = oseo.DeliveryAddressType(firstName='Ricardo') dit.toxml() UnboundElementError: Instance of type { http://www.opengis.net/oseo/1.0}DeliveryInformationType has no bound element for start tag I'm using pyxb version 1.2.3 downloaded from pypi How can I overcome this issue? Thanks in advance -- ___________________________ ___ __ Ricardo Garcia Silva |
From: Peter B. <bi...@ac...> - 2014-02-18 16:27:37
|
_PluralBinding was added in PyXB 1.2.1 to resolve: https://sourceforge.net/apps/trac/pyxb/ticket/69 Using a list for elements with multiplicity greater than one bypassed PyXB's ability to validate when the containing element added new content. A more informed container was necessary. A _PluralBinding instance should support all the methods of a Python list including treating them as iterators, but it doesn't have __add__. I could add that method, but it would only work for pb+list, not for list+pb, so it'd be fragile. Best solution is to refactor your code. Peter On Tue, Feb 18, 2014 at 9:32 AM, Patrick Byrne <pjl...@gm...> wrote: > Hi, > > I am attempting to upgrade our system from Pytbon2.6/PyXB-1.1.4 to > Python-2.7.4/PyXB-1.2.3. I am seeing a number of errors with our scripts > where a PluralBinding class is treated like a list. > > Eg1: > this code > for MuxInput in If.sdr_mux_input + ["default"]: > gives: > TypeError: unsupported operand type(s) for +: '_PluralBinding' and 'list' > > Eg2: > this code: > SdrIfs = Die.sdr_interface > MuxedSdrIfs = Die.muxed_sdr_interface > DdrIfs = Die.ddr_interface > for If in SdrIfs + MuxedSdrIfs + DdrIfs: > gives: > TypeError: unsupported operand type(s) for +: '_PluralBinding' and > '_PluralBinding' > > Can someone enlighten me as to what is going on here? I see that the > _PluralBinding class is trying to behave like a list. It does not appear to > be present at all in content.py in PyXB-1.1.4. > > Thanks. > > -- > Patrick Byrne > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > > |
From: Patrick B. <pjl...@gm...> - 2014-02-18 15:32:34
|
Hi, I am attempting to upgrade our system from Pytbon2.6/PyXB-1.1.4 to Python-2.7.4/PyXB-1.2.3. I am seeing a number of errors with our scripts where a PluralBinding class is treated like a list. Eg1: this code for MuxInput in If.sdr_mux_input + ["default"]: gives: TypeError: unsupported operand type(s) for +: '_PluralBinding' and 'list' Eg2: this code: SdrIfs = Die.sdr_interface MuxedSdrIfs = Die.muxed_sdr_interface DdrIfs = Die.ddr_interface for If in SdrIfs + MuxedSdrIfs + DdrIfs: gives: TypeError: unsupported operand type(s) for +: '_PluralBinding' and '_PluralBinding' Can someone enlighten me as to what is going on here? I see that the _PluralBinding class is trying to behave like a list. It does not appear to be present at all in content.py in PyXB-1.1.4. Thanks. -- Patrick Byrne |
From: Peter B. <bi...@ac...> - 2014-02-16 23:18:26
|
PyXB already uses a single-source: the python2 version is primary and python3 is derived automatically by it, but not in a way that could be executed at installation time on an arbitrary user system. Roughly 100 files in the distribution must be changed to work with python3: to a large extent because pyxb must use unicode string literals like u'this' and python3 wouldn't accept that syntax until PEP 414 in version 3.3. The distribution is big enough I'm not going to put complete source for both versions in the same tar file. I'll keep my mind open on this, but for the foreseeable future chances are if you want the python3 stuff you'll have to get it from git, not PyPI. The best chance for a mixed-version source is if I don't support python3 older than version 3.3, which probably isn't feasible for a few more years. Peter On Sun, Feb 16, 2014 at 5:02 PM, 翁哲 <wen...@gm...> wrote: > Find this might be useful. > > > stackoverflow.com/questions/2398626/how-to-organize-python-modules-for-pypi-to-support-2-x-and-3-x > > > 2014-02-17 9:45 GMT+11:00 翁哲 <wen...@gm...>: > > Hi, >> >> Yes, I'm starting to look into this. Besides, I think this is would be a >> quite beneficial chance for PyXB to add support to python 3.x, whichever a >> python 2.x and 3.x dual release or a first-go python 3.x release. >> >> Cheers, >> John >> >> >> >> ----- Original Message ----- >> From: Nathan Robertson <na...@na...> >> Date: 12 February 2014 15:50 >> Subject: Re: [pyxb-users] Python 3.x testing >> To: Peter Bigot <bi...@ac...> >> Cc: PyXB Users <pyx...@li...> >> >> >> Ok, I'll get one of my guys to take a look at that in the coming weeks. >> >> >> On 12 February 2014 14:48, Peter Bigot <bi...@ac...> wrote: >> >> > I'm still considering the future of 1.2.x versus 1.3 versus 2.0. I >> don't >> > anticipate there being a dual release unless there's some way to have >> the >> > same version number with different tar files support python2 and python3 >> > under PyPI, which seems to be the way most people get PyXB these days. >> At >> > this time I don't think it's possible to have a source release that >> > supports both versions, and I won't be dropping 2.x support, but I'll >> look >> > into that before the next release (whenever that may be). >> > >> > Peter >> > >> > >> > On Tue, Feb 11, 2014 at 8:23 PM, Nathan Robertson <na...@na... >> >wrote: >> > >> >> Hi Peter, >> >> >> >> Sure, thanks. We're still running 1.2.2 in production at the moment >> >> anyway, so we're missing those changes in any case. >> >> >> >> If you could resync the python3 dev branch at some point in the next >> few >> >> weeks or so that'd be great - I'll be assigning one of my programmers >> to >> >> gradually working away at Python 3.x issues in our code, and once he's >> done >> >> with that we'll be looking to send it to production. Is 1.2.4 intended >> to >> >> be a Python 2.x and Python 3.x dual release? >> >> >> >> Regards, >> >> Nathan. >> >> >> >> >> >> >> >> On 12 February 2014 12:28, Peter Bigot <bi...@ac...> wrote: >> >> >> >>> Yes. I don't keep it up to date with the latest changes to the next >> >>> branch (e.g. it doesn't have the xs:decimal changes), but if you have >> >>> problems with it I can take a look and resync it. >> >>> >> >>> Peter >> >>> >> >>> >> >>> On Tue, Feb 11, 2014 at 5:36 PM, Nathan Robertson < >> na...@na...>wrote: >> >>> >> >>>> Hi, >> >>>> >> >>>> More an FYI for Peter than anything else. >> >>>> >> >>>> A couple of weeks ago we removed our last remaining Python 3.x >> >>>> incompatible package (Twisted) after rewriting the code that >> depended on >> >>>> it. So, we're now Python 3.x ready, and so we will begin testing the >> >>>> pyxb-1.2.3-DEV branch referenced in Peter's mailing list post of 16th >> >>>> September 2013 which works with Python 3.x (I'm assuming that branch >> is >> >>>> still the latest Python 3.x compatible one?). >> >>>> >> >>>> Anyway, I'll let you know how we go over the coming weeks. >> >>>> >> >>>> Nathan. >> >>>> >> >>>> >> >>>> >> >>>> >> ------------------------------------------------------------------------------ >> >>>> Android apps run on BlackBerry 10 >> >>>> Introducing the new BlackBerry 10.2.1 Runtime for Android apps. >> >>>> Now with support for Jelly Bean, Bluetooth, Mapview and more. >> >>>> Get your Android app in front of a whole new audience. Start now. >> >>>> >> >>>> >> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk >> >>>> _______________________________________________ >> >>>> pyxb-users mailing list >> >>>> pyx...@li... >> >>>> https://lists.sourceforge.net/lists/listinfo/pyxb-users >> >>>> >> >>>> >> >>> >> >> >> > >> >> -- >> >> >> John Weng | Software Engineer >> Les Mills Asia Pacific | jo...@le... >> PO Box 3998 Manuka ACT 2603 AUSTRALIA >> tel 0415786645 | fax +612 6282 0563 | www.lesmills.com.au >> The contents of this email and its attachments are confidential and >> privileged. Any unauthorised use of the contents or trademarks is expressly >> prohibited. If you receive this email in error, please contact us, then >> delete the email and any attachments. BODYPUMP(R), BODYCOMBAT(R), BODYBALANCE(R), >> BODYSTEP(R), BODYATTACK(R), BODYJAM(R), RPM(tm), BODYVIVE(R), SH'BAM(R), CXWORX(R), LES >> MILLS GRIT(tm), BORN TO MOVE(tm), SMARTBAR(tm) and SMARTSTEP(tm) are all registered >> trademarks of Les Mills Asia Pacific. >> >> >> >> -- >> >> >> John Weng | Software Engineer >> Les Mills Asia Pacific | jo...@le... >> PO Box 3998 Manuka ACT 2603 AUSTRALIA >> tel 0415786645 | fax +612 6282 0563 | www.lesmills.com.au >> The contents of this email and its attachments are confidential and >> privileged. Any unauthorised use of the contents or trademarks is expressly >> prohibited. If you receive this email in error, please contact us, then >> delete the email and any attachments. BODYPUMP(R), BODYCOMBAT(R), BODYBALANCE(R), >> BODYSTEP(R), BODYATTACK(R), BODYJAM(R), RPM(tm), BODYVIVE(R), SH'BAM(R), CXWORX(R), LES >> MILLS GRIT(tm), BORN TO MOVE(tm), SMARTBAR(tm) and SMARTSTEP(tm) are all registered >> trademarks of Les Mills Asia Pacific. >> >> >> >> > |
From: Nathan R. <na...@na...> - 2014-02-12 04:50:34
|
Ok, I'll get one of my guys to take a look at that in the coming weeks. On 12 February 2014 14:48, Peter Bigot <bi...@ac...> wrote: > I'm still considering the future of 1.2.x versus 1.3 versus 2.0. I don't > anticipate there being a dual release unless there's some way to have the > same version number with different tar files support python2 and python3 > under PyPI, which seems to be the way most people get PyXB these days. At > this time I don't think it's possible to have a source release that > supports both versions, and I won't be dropping 2.x support, but I'll look > into that before the next release (whenever that may be). > > Peter > > > On Tue, Feb 11, 2014 at 8:23 PM, Nathan Robertson <na...@na...>wrote: > >> Hi Peter, >> >> Sure, thanks. We're still running 1.2.2 in production at the moment >> anyway, so we're missing those changes in any case. >> >> If you could resync the python3 dev branch at some point in the next few >> weeks or so that'd be great - I'll be assigning one of my programmers to >> gradually working away at Python 3.x issues in our code, and once he's done >> with that we'll be looking to send it to production. Is 1.2.4 intended to >> be a Python 2.x and Python 3.x dual release? >> >> Regards, >> Nathan. >> >> >> >> On 12 February 2014 12:28, Peter Bigot <bi...@ac...> wrote: >> >>> Yes. I don't keep it up to date with the latest changes to the next >>> branch (e.g. it doesn't have the xs:decimal changes), but if you have >>> problems with it I can take a look and resync it. >>> >>> Peter >>> >>> >>> On Tue, Feb 11, 2014 at 5:36 PM, Nathan Robertson <na...@na...>wrote: >>> >>>> Hi, >>>> >>>> More an FYI for Peter than anything else. >>>> >>>> A couple of weeks ago we removed our last remaining Python 3.x >>>> incompatible package (Twisted) after rewriting the code that depended on >>>> it. So, we're now Python 3.x ready, and so we will begin testing the >>>> pyxb-1.2.3-DEV branch referenced in Peter's mailing list post of 16th >>>> September 2013 which works with Python 3.x (I'm assuming that branch is >>>> still the latest Python 3.x compatible one?). >>>> >>>> Anyway, I'll let you know how we go over the coming weeks. >>>> >>>> Nathan. >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Android apps run on BlackBerry 10 >>>> Introducing the new BlackBerry 10.2.1 Runtime for Android apps. >>>> Now with support for Jelly Bean, Bluetooth, Mapview and more. >>>> Get your Android app in front of a whole new audience. Start now. >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> pyxb-users mailing list >>>> pyx...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pyxb-users >>>> >>>> >>> >> > |
From: Peter B. <bi...@ac...> - 2014-02-12 03:48:52
|
I'm still considering the future of 1.2.x versus 1.3 versus 2.0. I don't anticipate there being a dual release unless there's some way to have the same version number with different tar files support python2 and python3 under PyPI, which seems to be the way most people get PyXB these days. At this time I don't think it's possible to have a source release that supports both versions, and I won't be dropping 2.x support, but I'll look into that before the next release (whenever that may be). Peter On Tue, Feb 11, 2014 at 8:23 PM, Nathan Robertson <na...@na...>wrote: > Hi Peter, > > Sure, thanks. We're still running 1.2.2 in production at the moment > anyway, so we're missing those changes in any case. > > If you could resync the python3 dev branch at some point in the next few > weeks or so that'd be great - I'll be assigning one of my programmers to > gradually working away at Python 3.x issues in our code, and once he's done > with that we'll be looking to send it to production. Is 1.2.4 intended to > be a Python 2.x and Python 3.x dual release? > > Regards, > Nathan. > > > > On 12 February 2014 12:28, Peter Bigot <bi...@ac...> wrote: > >> Yes. I don't keep it up to date with the latest changes to the next >> branch (e.g. it doesn't have the xs:decimal changes), but if you have >> problems with it I can take a look and resync it. >> >> Peter >> >> >> On Tue, Feb 11, 2014 at 5:36 PM, Nathan Robertson <na...@na...>wrote: >> >>> Hi, >>> >>> More an FYI for Peter than anything else. >>> >>> A couple of weeks ago we removed our last remaining Python 3.x >>> incompatible package (Twisted) after rewriting the code that depended on >>> it. So, we're now Python 3.x ready, and so we will begin testing the >>> pyxb-1.2.3-DEV branch referenced in Peter's mailing list post of 16th >>> September 2013 which works with Python 3.x (I'm assuming that branch is >>> still the latest Python 3.x compatible one?). >>> >>> Anyway, I'll let you know how we go over the coming weeks. >>> >>> Nathan. >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Android apps run on BlackBerry 10 >>> Introducing the new BlackBerry 10.2.1 Runtime for Android apps. >>> Now with support for Jelly Bean, Bluetooth, Mapview and more. >>> Get your Android app in front of a whole new audience. Start now. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> pyxb-users mailing list >>> pyx...@li... >>> https://lists.sourceforge.net/lists/listinfo/pyxb-users >>> >>> >> > |
From: Nathan R. <na...@na...> - 2014-02-12 02:23:23
|
Hi Peter, Sure, thanks. We're still running 1.2.2 in production at the moment anyway, so we're missing those changes in any case. If you could resync the python3 dev branch at some point in the next few weeks or so that'd be great - I'll be assigning one of my programmers to gradually working away at Python 3.x issues in our code, and once he's done with that we'll be looking to send it to production. Is 1.2.4 intended to be a Python 2.x and Python 3.x dual release? Regards, Nathan. On 12 February 2014 12:28, Peter Bigot <bi...@ac...> wrote: > Yes. I don't keep it up to date with the latest changes to the next > branch (e.g. it doesn't have the xs:decimal changes), but if you have > problems with it I can take a look and resync it. > > Peter > > > On Tue, Feb 11, 2014 at 5:36 PM, Nathan Robertson <na...@na...>wrote: > >> Hi, >> >> More an FYI for Peter than anything else. >> >> A couple of weeks ago we removed our last remaining Python 3.x >> incompatible package (Twisted) after rewriting the code that depended on >> it. So, we're now Python 3.x ready, and so we will begin testing the >> pyxb-1.2.3-DEV branch referenced in Peter's mailing list post of 16th >> September 2013 which works with Python 3.x (I'm assuming that branch is >> still the latest Python 3.x compatible one?). >> >> Anyway, I'll let you know how we go over the coming weeks. >> >> Nathan. >> >> >> >> ------------------------------------------------------------------------------ >> Android apps run on BlackBerry 10 >> Introducing the new BlackBerry 10.2.1 Runtime for Android apps. >> Now with support for Jelly Bean, Bluetooth, Mapview and more. >> Get your Android app in front of a whole new audience. Start now. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk >> _______________________________________________ >> pyxb-users mailing list >> pyx...@li... >> https://lists.sourceforge.net/lists/listinfo/pyxb-users >> >> > |
From: Peter B. <bi...@ac...> - 2014-02-12 01:28:54
|
Yes. I don't keep it up to date with the latest changes to the next branch (e.g. it doesn't have the xs:decimal changes), but if you have problems with it I can take a look and resync it. Peter On Tue, Feb 11, 2014 at 5:36 PM, Nathan Robertson <na...@na...>wrote: > Hi, > > More an FYI for Peter than anything else. > > A couple of weeks ago we removed our last remaining Python 3.x > incompatible package (Twisted) after rewriting the code that depended on > it. So, we're now Python 3.x ready, and so we will begin testing the > pyxb-1.2.3-DEV branch referenced in Peter's mailing list post of 16th > September 2013 which works with Python 3.x (I'm assuming that branch is > still the latest Python 3.x compatible one?). > > Anyway, I'll let you know how we go over the coming weeks. > > Nathan. > > > > ------------------------------------------------------------------------------ > Android apps run on BlackBerry 10 > Introducing the new BlackBerry 10.2.1 Runtime for Android apps. > Now with support for Jelly Bean, Bluetooth, Mapview and more. > Get your Android app in front of a whole new audience. Start now. > > http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > > |
From: Nathan R. <na...@na...> - 2014-02-12 00:41:32
|
Hi, More an FYI for Peter than anything else. A couple of weeks ago we removed our last remaining Python 3.x incompatible package (Twisted) after rewriting the code that depended on it. So, we're now Python 3.x ready, and so we will begin testing the pyxb-1.2.3-DEV branch referenced in Peter's mailing list post of 16th September 2013 which works with Python 3.x (I'm assuming that branch is still the latest Python 3.x compatible one?). Anyway, I'll let you know how we go over the coming weeks. Nathan. |
From: Peter B. <bi...@ac...> - 2014-02-11 12:51:52
|
On Mon, Feb 10, 2014 at 9:52 PM, <py...@ra...> wrote: > hi, > > i've just installed pyxb-1.2.3 into python-2.7 > (via macports) on macosx-10.6.8 to validate xml > documents against an xsd file but the validation > errors that i'm seeing are not the nice informative > ones as described in: > > http://pyxb.sourceforge.net/userref_validating.html > > instead of seeing line/column numbers and element names, > i'm seeing: > > pyxb.exceptions_.SimpleFacetValueError: > Type <class 'sampleschema.STD_ANON_12'> minLength constraint violated by > value > > btw, the code supplied in the url above assumes that the exception > will be pyxb.UnrecognizedContentError but > pyxb.exceptions_.SimpleFacetValueError > doesn't seem to be a subclass of that. > > any idea what i've done wrong? > You haven't done anything wrong; it's just that not all error messages are as informative. If the automata-based content model was violated for a complex type, you'd see the sort of detail shown in the user manual: those errors tend to be complex and need that level of detail to be understood. For a facet violation the current message is only what you see. Without seeing the schema I can't interpret it other than it appears there's a local simpleType used as a nested element (so it has no XML name as a type) that requires something longer than an empty string. (The message is "by value %s", which could be improved so the absence of a value is more clear.) SimpleFacetValueError is not an UnrecognizedContentError. You can see the exception hierarchy at: http://pyxb.sourceforge.net/userref_validating.html#runtime-exception-hierarchy The API is at: http://pyxb.sourceforge.net/api/index.html >From there you can go into pyxb.exceptions_ and see that SimpleFacetValueError has properties for the type, value, and the facet that was violated. You should be able to print e.location to see the line/column in the input where the problem was identified. You can also print e.type._location() to see where in the schema the anonymous type appears, or delve into e.facet to find what its minimum length is. You can also look at the generated bindings; the definition for STD_ANON_12 should also tell you where in the schema the definition occurred and the minimum length for an acceptable value. also, am i right in thinkng that there is no way to obtain > a list of all validation errors in a document (like xmllint)? > Yes. That is not a function that PyXB supports. Peter |
From: <py...@ra...> - 2014-02-11 03:52:23
|
hi, i've just installed pyxb-1.2.3 into python-2.7 (via macports) on macosx-10.6.8 to validate xml documents against an xsd file but the validation errors that i'm seeing are not the nice informative ones as described in: http://pyxb.sourceforge.net/userref_validating.html instead of seeing line/column numbers and element names, i'm seeing: pyxb.exceptions_.SimpleFacetValueError: Type <class 'sampleschema.STD_ANON_12'> minLength constraint violated by value btw, the code supplied in the url above assumes that the exception will be pyxb.UnrecognizedContentError but pyxb.exceptions_.SimpleFacetValueError doesn't seem to be a subclass of that. any idea what i've done wrong? i generated the module with: $ pyxbgen -u sample-schema.xsd -m sampleschema Python for AbsentNamespace0 requires 1 modules and the client code is: import sys, pyxb, sampleschema if len(sys.argv) != 2: print('usage: %s sample.xml' % sys.argv[0]) exit(0) xmlbytes = open(sys.argv[1]).read() xmlparsed = None try: xmlparsed = sampleschema.CreateFromDocument(xmlbytes) except pyxb.UnrecognizedContentError as e: print('Error validating XML\n%s' % e.details()) except Exception as e: print('Unknown XML validation error\n%s\n%s' % (type(e), e.details())) which outputs: Unknown XML validation error <class 'pyxb.exceptions_.SimpleFacetValueError'> Type <class 'sampleschema.STD_ANON_12'> minLength constraint violated by value also, am i right in thinkng that there is no way to obtain a list of all validation errors in a document (like xmllint)? thanks, raf |
From: Peter B. <bi...@ac...> - 2014-02-05 19:13:42
|
This issue has been resolved in the next branch of the git repository. It's scheduled to be part of PyXB 1.2.4 (whenever that happens), but because decimal.Decimal is not fully interoperable with float this may cause user-level breakage. It would be helpful if anybody who knowingly uses xsd:decimal would give this a try before it becomes part of a formal release and therefore harder to fix. Peter On Tue, Mar 12, 2013 at 9:26 PM, Peter Bigot <bi...@ac...> wrote: > This issue also exists as: > https://sourceforge.net/apps/trac/pyxb/ticket/91 > > Based on a very quick review of the comments in that ticket, as well as > the original discussion that it references, it is unlikely that the base > type underlying the decimal type in PyXB will change because there seem to > be a couple incompatibilities between Python decimal and XML Schema > decimal, including the effect of significant digits and lack of support for > certain operators. > > I'd have to spend some time analyzing all that to determine what the > correct change would be, informed by how people actually use xs:decimal as > opposed to xs:float. It might be something to revisit if/when there's a > Python3 update to PyXB, but don't count on it happening spontaneously any > time soon. > > Peter > > > On Tue, Mar 12, 2013 at 8:28 PM, Nathan Robertson <na...@na...>wrote: > >> Hi, >> >> I was just looking at the PyXB API documentation. Is there any difference >> in the PyXB implementation of xsd:float from xsd:decimal? Looking at: >> >> http://pyxb.sourceforge.net/api/pyxb.binding.datatypes.decimal-class.html >> >> it says that it inherits from the Python float type, which is an IEEE >> binary floating point number. The XML Schema specification says that >> xsd:float should be a 32 bit IEEE floating point number, but it seems stops >> short on defining xsd:decimal as arbitrary precision - it just says at >> least 18 decimal digits must be supported. But it is certainly true that >> the way they define and describe xsd:float vs. xsd:decimal are quite >> different. >> >> (http://www.w3.org/TR/xmlschema-2/#decimal) >> >> I note in the PyXB documentation it says: >> >> "*To Do:* The Python base type for this is wrong. Consider >> http://code.google.com/p/mpmath/". >> >> Is there any reason why the base python type shouldn't just be the built >> in decimal type? From what I gather, this is arbitrary precision. As a >> point of note, JAXB uses java.lang.BigDecimal (arbitrary precision floating >> point number) for xsd:decimal. >> >> Traditionally, we (as in, at my workplace) have used xsd:decimal for >> monetary values in our XML documents, and obviously want to ensure that >> under no circumstances these get rounded. I'm thinking of changing all the >> types in my XML schema to xsd:string to avoid this type mapping issue, and >> manually converting the string to an arbitrary precision decimal type >> (probably the inbuilt python decimal type). But before I do that, is there >> any chance that the type that PyXB uses can be or will be changed from >> being based on an IEEE floating point number (with it's rounding and >> precision issues) to an arbitrary precision decimal type of some sort? >> Doing so seems to make sense - if the user really wants IEEE floating >> point, xsd:float is the XML Schema type for that. And the documentation >> seems to suggest that this was the thinking, at least at some point in the >> past. >> >> Or am I missing something here? >> >> Regards, >> Nathan. >> >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_mar >> _______________________________________________ >> pyxb-users mailing list >> pyx...@li... >> https://lists.sourceforge.net/lists/listinfo/pyxb-users >> >> > |
From: Peter B. <bi...@ac...> - 2013-11-13 19:24:35
|
Look more carefully at the schema. You're creating an MD_ScopeCode element, which is type gco:CodeListValue_Type. hierarchyLevel is a plural element with underlying type MD_ScopeCode_PropertyType. That type in turn attaches an attribute to an element that contains multiple MD_ScopeCode elements. So you need something like: import pyxb import pyxb.bundles.opengis.iso19139.v20070417.gmd as gmd md = gmd.MD_Metadata() scope_code = gmd.MD_ScopeCode('dataset', codeList='uglystring', codeListValue='dataset') # Can't add one of these in isolation try: md.hierarchyLevel.append(scope_code) except pyxb.ValidationError: pass # Instead, make it a member scpt = gmd.MD_ScopeCode_PropertyType().append(scope_code) md.hierarchyLevel.append(scpt) It would help if it were easier to see what type of element the plural binding expects; it's a private attribute, so you can get to it this way: >>> md.hierarchyLevel._PluralBinding__elementBinding.typeDefinition() <class 'pyxb.bundles.opengis.raw._nsgroup_.MD_ScopeCode_PropertyType'> Take advantage of tab completion in the Python shell to expose the contents of attributes like this. I've added ticket 220 to improve the interface to this information. Peter On Wed, Nov 13, 2013 at 11:05 AM, Ricardo Filipe Soares Garcia da < ric...@gm...> wrote: > Hi list > > I am trying to create a gmd:MD_Metadata instance. I am using pyxb v1.2.3 > as downloaded from pypi. I am using the opengis bindings. > > My ultimate goal is to create an ISO19139 compliant MD_Metadata XML for > some satellite imagery datasets. This metadata will then be submitted to an > OGC compliant catalogue (CSW) server. > > I am currently struggling to define the hierarchyLevel for my MD_Metadata > element. It must be defined as an MD_ScopeCode element with the 'dataset' > value. I am getting the following error: > > >>> import pyxb.bundles.opengis.iso19139.v20070417.gmd as gm > >>> md = gmd.MD_Metadata() > >>> scope_code = gmd.MD_ScopeCode('dataset', >>> codeList='' > http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode', > codeListValue='dataset') > >>> md.hierarchyLevel > <pyxb.binding.content._PluralBinding at 0x591ad10> > >>> md.hierarchyLevel.append(scope_code) > SimpleTypeValueError: Type { > http://www.isotc211.org/2005/gmd}MD_ScopeCode_PropertyType cannot be > created from {http://www.isotc211.org/2005/gco}CodeListValue_Type: > <pyxb.bundles.opengis.raw._nsgroup_.CodeListValue_Type object at 0x590dd90> > > How can insert the hierarchyLevel information into my MD_Metadata object? > > Thanks in advance > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > > ------------------------------------------------------------------------------ > DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps > OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access > Free app hosting. Or install the open source package on any LAMP server. > Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! > http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > > |
From: Ricardo F. S. G. da <ric...@gm...> - 2013-11-13 17:06:20
|
Hi list I am trying to create a gmd:MD_Metadata instance. I am using pyxb v1.2.3 as downloaded from pypi. I am using the opengis bindings. My ultimate goal is to create an ISO19139 compliant MD_Metadata XML for some satellite imagery datasets. This metadata will then be submitted to an OGC compliant catalogue (CSW) server. I am currently struggling to define the hierarchyLevel for my MD_Metadata element. It must be defined as an MD_ScopeCode element with the 'dataset' value. I am getting the following error: >>> import pyxb.bundles.opengis.iso19139.v20070417.gmd as gm >>> md = gmd.MD_Metadata() >>> scope_code = gmd.MD_ScopeCode('dataset', >>> codeList='' http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode', codeListValue='dataset') >>> md.hierarchyLevel <pyxb.binding.content._PluralBinding at 0x591ad10> >>> md.hierarchyLevel.append(scope_code) SimpleTypeValueError: Type { http://www.isotc211.org/2005/gmd}MD_ScopeCode_PropertyType cannot be created from {http://www.isotc211.org/2005/gco}CodeListValue_Type: <pyxb.bundles.opengis.raw._nsgroup_.CodeListValue_Type object at 0x590dd90> How can insert the hierarchyLevel information into my MD_Metadata object? Thanks in advance -- ___________________________ ___ __ Ricardo Garcia Silva |
From: Thierry L. <thi...@as...> - 2013-10-28 22:26:08
|
Hello, First excuse me for this post. It's so stupid but I'm not a Python expert and a xml expert. I must add security to an existing SOAP Request. As documentations, I have some java class, a sample to use it, a sample of the signed request and the wsdl ans xsd. I don't take time to study WSDL and XSD theory :(. I have some troubles : I can't generate the binding using the wsdl. C:\Users\tleurent\Documents\OSSOM\EBox\Python\WSDL\fromJAR\wsdl>c:\Python27\python.exe c:\Python27\Scripts\pyxbgen -W EboxMessage_v1.wsdl Retrieving WSDL from C:\Users\tleurent\Documents\OSSOM\EBox\Python\WSDL\fromJAR\wsdl\EboxMessage_v1.wsdl WARNING:pyxb.binding.basis:Unable to convert DOM node {http://www.w3.org/2001/XMLSchema}schema at C:\Users\tleurent\Documents\OSSOM\EBox\Python\WSDL\fromJAR\wsdl\EboxMessage_v1.wsdl[6:2] to binding PS urn:uuid:cc78d7c0-3fbc-11e3-a3ab-ed71efb131ed Exception generating bindings: Target file .\_err.py for module MR[urn:uuid:cc78d7c0-3fbc-11e3-a3ab-ed71efb131ed]@http://socialsecurity.be/errors/serviceprovider/v1 bindings exists with other content Traceback (most recent call last): File "c:\Python27\Scripts\pyxbgen", line 64, in <module> modules = generator.bindingModules() File "c:\Python27\lib\site-packages\pyxb\binding\generate.py", line 2857, in bindingModules self.__generateBindings() File "c:\Python27\lib\site-packages\pyxb\binding\generate.py", line 2796, in __generateBindings nsm = NamespaceModule(self, mr, mr_scc) File "c:\Python27\lib\site-packages\pyxb\binding\generate.py", line 1612, in __init__ self._setModulePath(generator.modulePathData(self)) File "c:\Python27\lib\site-packages\pyxb\binding\generate.py", line 1873, in modulePathData raise pyxb.BindingGenerationError('Target file %s for module %s bindings exists with other content' % (binding_file_path, mr)) BindingGenerationError: Target file .\_err.py for module MR[urn:uuid:cc78d7c0-3fbc-11e3-a3ab-ed71efb131ed]@http://socialsecurity.be/errors/serviceprovider/v1 bindings exists with other content 2 after generate a sample xml file with XMLSpy and a binding using an xsd. I have a NamesapceError : http://schemas.xmlsoap.org/soap/envelope/ has no category elementBinding. 3 I will create this line <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" S:mustUnderstand="1"> using pyxb.utils.domutils.BindingDOMSupport.DeclareNamespace( wsse.Namespace, 'wsse' ) and security = wsse.Security() But I don't find how add "S:mustUnderstand". 4 How to add element to an existing schema ? Thanks for your help -- Thierry Leurent -- Thierry Leurent Phone : +32 476/20.23.98 E-mail : thi...@as... Website (en developpement) : http://www.asgardian.be |
From: Peter B. <bi...@ac...> - 2013-10-10 11:38:21
|
You're welcome. Building the opengis bindings from the git repository should work. I use: maintainer/genbundles opengis from the root of the git workspace. (I configure to use that workspace with something like: PYXB_ROOT=$(pwd) . maintainer/use-pyxb which may be necessary to set PYXB_ROOT, PYTHONPATH, and PATH.) I've added oseo and wps to the standard set built for opengis. There's no reason they're excluded other than that they probably didn't exist when I first started generating OpenGIS bindings. Peter On Thu, Oct 10, 2013 at 5:07 AM, Ricardo Filipe Soares Garcia da <ric...@gm...> wrote: > Thanks a lot Peter! > > The version in pypi works OK now. > > I also tried getting the code directly from the git repository, but I could > not use the genbind script of the opengis bundle. It fails when building the > bindings for gml3_2. I guess this is a work in progress. > > I'll stick with the pypi version for now (already have a fab file to pull it > and build the opengis schemas with added oseo and wps) and just use the > workaround you provided. > > It's great to see things being fixed at such blazing speed :) > > Best regards > > > On Wed, Oct 9, 2013 at 8:20 PM, Peter Bigot <bi...@ac...> wrote: >> >> Thanks; my notes on how to do a release on PyPI didn't make the upload >> step clear. I've now uploaded a copy of 1.2.3 to PyPI directly and it >> appears that it will work. I don't normally use it, though, so if you >> continue to have problems please reply with details on how it's >> failing now. >> >> FWIW, your problem with Literal and append is >> https://sourceforge.net/apps/trac/pyxb/ticket/219 and a fix is in the >> git repository on sourceforge. >> >> Peter >> >> On Wed, Oct 9, 2013 at 2:08 PM, Ricardo Filipe Soares Garcia da >> <ric...@gm...> wrote: >> > Hi list >> > >> > I am trying to download version 1.2.3 using pip: >> > >> > pip install pyxb >> > >> > and it is installing version 1.2.2 instead. Running the command with >> > more >> > verbosity (-v -v -v) shows that pip can find the 1.2.3 version but >> > doesn't >> > fetch it and it shows a bunch of links not found warnings. Can there be >> > a >> > problem with the package on pypi or maybe its me having some issue with >> > my >> > machine? >> > >> > I am instaaling pyxb into a virtualenv. >> > >> > Best regards >> > >> > -- >> > ___________________________ ___ __ >> > Ricardo Garcia Silva >> > >> > >> > ------------------------------------------------------------------------------ >> > October Webinars: Code for Performance >> > Free Intel webinars can help you accelerate application performance. >> > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >> > from >> > the latest Intel processors and coprocessors. See abstracts and register >> > > >> > >> > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >> > _______________________________________________ >> > pyxb-users mailing list >> > pyx...@li... >> > https://lists.sourceforge.net/lists/listinfo/pyxb-users >> > > > > > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > |
From: Ricardo F. S. G. da <ric...@gm...> - 2013-10-10 10:08:01
|
Thanks a lot Peter! The version in pypi works OK now. I also tried getting the code directly from the git repository, but I could not use the genbind script of the opengis bundle. It fails when building the bindings for gml3_2. I guess this is a work in progress. I'll stick with the pypi version for now (already have a fab file to pull it and build the opengis schemas with added oseo and wps) and just use the workaround you provided. It's great to see things being fixed at such blazing speed :) Best regards On Wed, Oct 9, 2013 at 8:20 PM, Peter Bigot <bi...@ac...> wrote: > Thanks; my notes on how to do a release on PyPI didn't make the upload > step clear. I've now uploaded a copy of 1.2.3 to PyPI directly and it > appears that it will work. I don't normally use it, though, so if you > continue to have problems please reply with details on how it's > failing now. > > FWIW, your problem with Literal and append is > https://sourceforge.net/apps/trac/pyxb/ticket/219 and a fix is in the > git repository on sourceforge. > > Peter > > On Wed, Oct 9, 2013 at 2:08 PM, Ricardo Filipe Soares Garcia da > <ric...@gm...> wrote: > > Hi list > > > > I am trying to download version 1.2.3 using pip: > > > > pip install pyxb > > > > and it is installing version 1.2.2 instead. Running the command with more > > verbosity (-v -v -v) shows that pip can find the 1.2.3 version but > doesn't > > fetch it and it shows a bunch of links not found warnings. Can there be a > > problem with the package on pypi or maybe its me having some issue with > my > > machine? > > > > I am instaaling pyxb into a virtualenv. > > > > Best regards > > > > -- > > ___________________________ ___ __ > > Ricardo Garcia Silva > > > > > ------------------------------------------------------------------------------ > > October Webinars: Code for Performance > > Free Intel webinars can help you accelerate application performance. > > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > > from > > the latest Intel processors and coprocessors. See abstracts and register > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > > _______________________________________________ > > pyxb-users mailing list > > pyx...@li... > > https://lists.sourceforge.net/lists/listinfo/pyxb-users > > > -- ___________________________ ___ __ Ricardo Garcia Silva |
From: Peter B. <bi...@ac...> - 2013-10-09 19:20:39
|
Thanks; my notes on how to do a release on PyPI didn't make the upload step clear. I've now uploaded a copy of 1.2.3 to PyPI directly and it appears that it will work. I don't normally use it, though, so if you continue to have problems please reply with details on how it's failing now. FWIW, your problem with Literal and append is https://sourceforge.net/apps/trac/pyxb/ticket/219 and a fix is in the git repository on sourceforge. Peter On Wed, Oct 9, 2013 at 2:08 PM, Ricardo Filipe Soares Garcia da <ric...@gm...> wrote: > Hi list > > I am trying to download version 1.2.3 using pip: > > pip install pyxb > > and it is installing version 1.2.2 instead. Running the command with more > verbosity (-v -v -v) shows that pip can find the 1.2.3 version but doesn't > fetch it and it shows a bunch of links not found warnings. Can there be a > problem with the package on pypi or maybe its me having some issue with my > machine? > > I am instaaling pyxb into a virtualenv. > > Best regards > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > |
From: Ricardo F. S. G. da <ric...@gm...> - 2013-10-09 19:09:00
|
Hi list I am trying to download version 1.2.3 using pip: pip install pyxb and it is installing version 1.2.2 instead. Running the command with more verbosity (-v -v -v) shows that pip can find the 1.2.3 version but doesn't fetch it and it shows a bunch of links not found warnings. Can there be a problem with the package on pypi or maybe its me having some issue with my machine? I am instaaling pyxb into a virtualenv. Best regards -- ___________________________ ___ __ Ricardo Garcia Silva |
From: Peter B. <bi...@ac...> - 2013-10-09 18:06:29
|
Try: import pyxb.bundles.opengis.iso19139.v20070417.gmd as gmd As of PyXB 1.2.3 the bindings are generated with this path, since the actual path is not permitted by Python. If you're using an older version of Python, update or edit the genbind script in the opengis bundle to correct the path as show below. Peter commit 7c7ebf682abff50835baad0fdd962a402791346b Author: Peter A. Bigot <pa...@pa...> Date: Sun Sep 15 15:03:17 2013 -0500 opengis: fix invalid module path Module components must be valid Python identifiers diff --git a/pyxb/bundles/opengis/scripts/genbind b/pyxb/bundles/opengis/scripts/genbind index 5f7a64d..8d191df 100755 --- a/pyxb/bundles/opengis/scripts/genbind +++ b/pyxb/bundles/opengis/scripts/genbind @@ -45,12 +45,12 @@ pyxbgen \ pyxbgen \ --location-prefix-rewrite=http://schemas.opengis.net/=${SCHEMA_DIR}/ \ --schema-location=${SCHEMA_DIR}/gml/3.2.1/gml.xsd --module=gml_3_2 \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gco/gco.xsd --module=iso19139.20070417.gco \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmd/gmd.xsd --module=iso19139.20070417.gmd \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmx/gmx.xsd --module=iso19139.20070417.gmx \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gsr/gsr.xsd --module=iso19139.20070417.gsr \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gss/gss.xsd --module=iso19139.20070417.gss \ - --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gts/gts.xsd --module=iso19139.20070417.gts \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gco/gco.xsd --module=iso19139.v20070417.gco \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmd/gmd.xsd --module=iso19139.v20070417.gmd \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gmx/gmx.xsd --module=iso19139.v20070417.gmx \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gsr/gsr.xsd --module=iso19139.v20070417.gsr \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gss/gss.xsd --module=iso19139.v20070417.gss \ + --schema-location=${SCHEMA_DIR}/iso/19139/20070417/gts/gts.xsd --module=iso19139.v20070417.gts \ --module-prefix=${MODULE_PREFIX} \ --write-for-customization \ --archive-to-file=${ARCHIVE_DIR}/gml_3_2.wxs \ On Wed, Oct 9, 2013 at 12:52 PM, Ricardo Filipe Soares Garcia da <ric...@gm...> wrote: > Hi list > > I'd like to construct some objects with the iso19139 gmd module. > However, I can't seem to be able to import it. > > In my installation path I have the following: > > $SITE_PACKAGES/pyxb/bundles/opengis/iso19139/20070417/gmd.py > > I'd hoped to import the gmd module in python by doing: > > import pyxb.bundles.opengis.iso19139.20070417.gmd as gmd > > But this raises a SyntaxError. I guess the reason is that Python does not > allow module or package names to start with a number. > > Is there some other way to import this module or am I facing a bug? > > Thanks in advance > > > -- > ___________________________ ___ __ > Ricardo Garcia Silva > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > pyxb-users mailing list > pyx...@li... > https://lists.sourceforge.net/lists/listinfo/pyxb-users > |