[xsd-users] RE: FpML output is not being produced properly

Cuneyt.Karadag at akbank.com Cuneyt.Karadag at akbank.com
Thu Apr 21 03:53:10 EDT 2011


Hi Boris,



I think I have a problem with serialization part of the xsd generated code.



First I have generated my xsd files without giving parameter "--generate-serialization"  and "--type-naming ucc". You can see the attached file.  But converting into a string was not working.



Then I have added the different parameters. When I generate the xsd file with serialization parameter I am always getting errors below

xsd cxx-tree --hxx-suffix .h --cxx-suffix .cc --generate-serialization --type-naming ucc --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 --namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig  xmldsig-core-schema.xsd



.../xsd/cxx/tree/serialization.txx", line 678: Error: The operation "DOMAttr<<std::string " is illegal.

.../xsd/cxx/tree/serialization.txx", line 671: Error: The operation "DOMElement<<std::string " is illegal.



One more question: Should I have to generate all the xsd files with the parameter "--generate-serialization?



By the way my sample code is in the attached document.



As an information our applications run on Solaris environment and I have downloaded the file xsd-3.3.0-sparc-solaris.tar.



Thanks for your helps.

Cuneyt.





-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: Wednesday, April 20, 2011 5:53 PM
To: Cüneyt Karadağ (BT Uygulama Geliştirme Bölümü)
Cc: xsd-users at codesynthesis.com; Şenel Hiçyılmaz (BT Uygulama Geliştirme Bölümü)
Subject: Re: FpML output is not being produced properly



Hi Cuneyt,



Cuneyt.Karadag at akbank.com <Cuneyt.Karadag at akbank.com> writes:



> When I would like to generate my FpML file, the output is always being

> produced as I shown below after the statement

>

> fpml47::FpML(std::cout, doc);

>

> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>

> <p1:FpML xmlns:p1="http://www.fpml.org/2009/FpML-4-7"/>



FpML and XSD are used successfully by quite a few people, both for reading

and writing. Can you show a small code example that creates the document?

As well as the XSD compiler options you used to compile the schemas.



Boris







________________________________
[http://www.akbank.com/images/disclaimer.jpg]<http://www.akbank.com/disclaimer.asp>

Bu e-posta ve muhtemel eklerinde verilen bilgiler kişiye özel ve gizli olup, yalnızca mesajda belirlenen alıcı ile ilgilidir. Size yanlışlıkla ulaşmışsa lütfen göndericiye bilgi veriniz, mesajı siliniz ve içeriğini başka bir kişiye açıklamayınız, herhangi bir ortama kopyalamayınız. Bu mesaj aksi sözleşme ile belirtilmedikçe herhangi bir finansal işlem teklifi, alımı, satımı veya herhangi bir havalenin teyidi gibi bankacılık işlemi yapılması amacını taşımamaktadır. Verilen tüm bilgilerin doğruluğu ve bütünlüğünün garantisi verilmemekte olup, önceden bildirilmeksizin değiştirilebilecektir. Bu mesajın içeriği Bankamızın resmi görüşlerini yansıtmayabileceğinden Akbank T.A.Ş. hiçbir hukuki sorumluluğu kabul etmez.
-------------- next part --------------
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-allocation-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-asset-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-bond-option-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-cd-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-com-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-confirmation-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-contract-notification-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-correlation-swaps-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-credit-event-notification-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-dividend-swaps-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-doc-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-enum-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-eq-shared-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-eqd-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-fx-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-ird-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-loan-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-main-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-matching-status-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-mktenv-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-msg-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-option-shared-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-posttrade-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-posttrade-confirmation-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-posttrade-execution-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-posttrade-negotiation-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-pretrade-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-reconciliation-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-reporting-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-return-swaps-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-riskdef-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-shared-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-trade-notification-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-tradeexec-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-valuation-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 fpml-variance-swaps-4-7.xsd
xsd cxx-tree --cxx-suffix .cc --hxx-suffix .h --namespace-map http://www.fpml.org/2009/FpML-4-7=fpml47 xmldsig-core-schema.xsd
-------------- next part --------------
    std::string FPML_VERSION = "4-7";
    fpml47::ValuationDocument doc(FPML_VERSION);

    fpml47::Party cptyA("cptyA");
    fpml47::Party cptyB("cptyB");

    fpml47::PartyOrAccountReference payerReference("cptyA");
    fpml47::PartyOrAccountReference receiverReference("cptyB");
    fpml47::Payment payment1(payerReference, receiverReference, fpml47::Money("USD", 100));
    fpml47::Payment payment2(receiverReference, payerReference, fpml47::Money("EUR", 200));
    fpml47::FxLeg fxLeg(payment1, payment2, fpml47::ExchangeRate(fpml47::QuotedCurrencyPair(fpml47::Currency("USD"),
                                                                 fpml47::Currency("EUR"),
                                                                 fpml47::QuoteBasisEnum::Currency1PerCurrency2), 0.75));

    fpml47::TradeHeader header(fpml47::IdentifiedDate(xml_schema::date(2011, 01, 01)));
    fpml47::Trade trade(header, fxLeg);

    doc.trade().push_back(trade);
    doc.party().push_back(cptyA);
    doc.party().push_back(cptyB);

    fpml47::FpML(std::cout, doc);


More information about the xsd-users mailing list