Hello group,

I have just upgraded from *1.2.4* to Pyxb *1.2.5* and run into a problem
with generating XML's.

Version 1.2.4 produced xml's that i exactly that i wanted.
In current release i am having additional namespace/attributes in output
xml that i want to remove.

This is *xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance>"*

I use common XSD schema:
~~~
<xs:schema xmlns="
http://www.six-interbank-clearing.com/de/pacs.008.001.02.ch.01";
    xmlns:xs="http://www.w3.org/2001/XMLSchema";
    targetNamespace="
http://www.six-interbank-clearing.com/de/pacs.008.001.02.ch.01";
    elementFormDefault="qualified">
(...)
~~~

my Python2.7 code:
~~~
    #doc = pacs008.Document()
    #doc.FIToFICstmrCdtTrf = fitoficstmrcdttrf

    # Namespace
    nsm = "http://www.six-interbank-clearing.com/de/pacs.008.001.02.ch.01";
    pyxb.utils.domutils.BindingDOMSupport.SetDefaultNamespace(nsm)

    try:
        doc.validateBinding()
        print doc.toDOM().toprettyxml(encoding='utf-8')
    except pyxb.ValidationError as e:
        logger.error(e.details())
~~~

*PyXB 1.2.4* output xml:
~~~
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="
http://www.six-interbank-clearing.com/de/pacs.008.001.02.ch.01";>
<FIToFICstmrCdtTrf>
<GrpHdr>
<MsgId>10112016014400-7b183cf30532</MsgId>
(...)
~~~

*PyXB 1.2.5* output xml:
~~~
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="
http://www.six-interbank-clearing.com/de/pacs.008.001.02.ch.01";
*xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance>"*>
<FIToFICstmrCdtTrf *xsi:type="FIToFICustomerCreditTransferV02_CH_pacs008"*>
<GrpHdr xsi:type="GroupHeader33_CH_pacs008">
<MsgId>10112016032100-8e23476821ef</MsgId>
(...)
~~~

My goal is to remove unneccesery (for my case) "xsi:type" attributes that
are added to many of output xml elements.
Was playing with pyxb.utils.domutils.BindingDOMSupport() class but with no
success.

Could You help me on that?

Regards,
Ryku
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to