From javier.gutierrez at web.de Mon Sep 6 13:49:36 2021 From: javier.gutierrez at web.de (Javier Gutierrez) Date: Tue Sep 7 09:55:27 2021 Subject: [xsd-users] Validation on save Message-ID: <009e01d7a347$92cccda0$b86668e0$@web.de> Hello Boris, I have an XSD with different constraints, e.g.: key references, unique and enumeration. The XML instance document gets validated correctly when I load it, i.e. an exception is thrown when a constraint is broken. But how to perform validation when editing or saving? The serialization does not seem to invoke any validation. I cannot find a flag for it, am I missing something? Thanks in advance, Javier Gutierrez -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 6009 bytes Desc: not available Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20210906/bc3804dc/smime.bin From satish.vangipuram at rbccm.com Mon Sep 6 19:40:19 2021 From: satish.vangipuram at rbccm.com (Vangipuram, Satish (CWM-NR)) Date: Tue Sep 7 09:55:27 2021 Subject: [xsd-users] fpml 5-12 compile error with vs2019 Message-ID: Hi boris, while trying to upgrade from fpml 5-10 to 5-12 vs2019 throws the following compiler error. 'recordkeeping::BrokerConfirmationType::brokerConfirmationTypeScheme_default_value_': definition of dllimport static data member not allowed I have not upgraded code to use c++11 yet and using version 4.0.0.142. Is there an option to address the above error? Fyi I am using the same set of generation options as fpml 5-10. Please set me know if any suggestions regarding version of xsd code generator or generation options. Thanks _______________________________________________________________________ This email is intended only for the use of the individual(s) to whom it is addressed and may be privileged and confidential. Unauthorised use or disclosure is prohibited. If you receive this e-mail in error, please advise immediately and delete the original message. This message may have been altered without your or our knowledge and the sender does not accept any liability for any errors or omissions in the message. Ce courriel est confidentiel et prot?g?. L'exp?diteur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) d?sign?(s) est interdite. Si vous recevez ce courriel par erreur, veuillez m'en aviser imm?diatement, par retour de courriel ou par un autre moyen. Please see link for RBCCM disclosures. https://www.rbccm.com/rbccm/policies-disclaimers.page From boris at codesynthesis.com Tue Sep 7 10:01:31 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Sep 7 09:59:59 2021 Subject: [xsd-users] Validation on save In-Reply-To: <009e01d7a347$92cccda0$b86668e0$@web.de> References: <009e01d7a347$92cccda0$b86668e0$@web.de> Message-ID: Javier Gutierrez writes: > I have an XSD with different constraints, e.g.: key references, unique and > enumeration. The XML instance document gets validated correctly when I load > it, i.e. an exception is thrown when a constraint is broken. But how to > perform validation when editing or saving? The serialization does not seem > to invoke any validation. I cannot find a flag for it, am I missing > something? There is no support for validation during serialization in XSD (let alone "when editing"). The best option would be to serialize (potentially to a memory buffer, if performance is important) and re-parse. From boris at codesynthesis.com Tue Sep 7 10:06:17 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Sep 7 10:04:46 2021 Subject: [xsd-users] fpml 5-12 compile error with vs2019 In-Reply-To: References: Message-ID: Vangipuram, Satish (CWM-NR) writes: > 'recordkeeping::BrokerConfirmationType::brokerConfirmationTypeScheme_default_value_': > definition of dllimport static data member not allowed Could you show both declaration (in BrokerConfirmationType) and definition of brokerConfirmationTypeScheme_default_value_ as well at the exact and complete diagnostics that you are getting? Also, could you search the generated code for any other copies of BrokerConfirmationType? From mowers at brsc.com Wed Sep 15 13:09:29 2021 From: mowers at brsc.com (Mark Mowers) Date: Thu Sep 16 01:35:26 2021 Subject: [xsd-users] XML string over Google Protocol Buffers. Message-ID: Issue: string appears empty on the the gRPC client side of the send. proto 3 file definition: message XMLReportRequestParams { } message XMLReportReply { string xml_string = 1; } service XMLReport { rpc GetXMLReport(XMLReportRequestParams) returns (stream XMLReportReply); } >From the CodeSynthesis, xsd cpp files, we have a structure called LOBType that gets populated with data. LOB is the definition that takes the LOBType to serialize it to ostringstream. Code in cpp server to create the XSD object and convert it to xml string: somname::v2::LOBType lobType (l_id); .... // lobType is populated with data types XSDErrorHandler errHandler; // My own generic error handler ::xml_schema::flags flags = 0; xml_schema::namespace_infomap map; map["aa"].schema = xmlObjs_xsd; // file schema name map["aa"].name = m_xml_xsd_schema; // path to file schema std::ostringstream ostrm; // format the LOB xml somname::v2::LOB (ostrm, lobType, errHandler, map, "UTF-8"); std::string xmlString = std::move (ostrm.str()); return xmlString; This string is then inserted into the XMLReportReply and then it is written out to the gRPC so the client can receive it. On the client side, the string is empty, no xml inside. Any thoughts? Am I doing the format of the xml string properly? Thanks. Mark Mowers BRSC From boris at codesynthesis.com Thu Sep 16 01:43:54 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Sep 16 01:42:20 2021 Subject: [xsd-users] XML string over Google Protocol Buffers. In-Reply-To: References: Message-ID: Mark Mowers writes: > somname::v2::LOBType lobType (l_id); > .... // lobType is populated with data types > XSDErrorHandler errHandler; // My own generic error handler > ::xml_schema::flags flags = 0; > xml_schema::namespace_infomap map; > map["aa"].schema = xmlObjs_xsd; // file schema name > map["aa"].name = m_xml_xsd_schema; // path to file schema > > std::ostringstream ostrm; > > // format the LOB xml > somname::v2::LOB (ostrm, lobType, errHandler, map, "UTF-8"); > > std::string xmlString = std::move (ostrm.str()); Try to print xmlString at this point (or view it in the debugger). Does it contain the expected XML? If yes, the problem is somewhere downstream (your code, gRPC, etc). If it is empty, then the issues is likely with the way you have setup the serialization. Try to replace it with just the call to the generated serialization function (without any custom error handlers, etc). If that makes a difference, then the problem is likely with your serialization code. (Perhaps there is an error but your error handler ignores it?) From marek.krzynowek at rbccm.com Wed Sep 29 05:06:32 2021 From: marek.krzynowek at rbccm.com (Krzynowek, Marek (CWM-NR)) Date: Wed Sep 29 05:04:59 2021 Subject: [xsd-users] Linker problem caused by using std::ifstream/std::ofstream/std::fstream together with xsd::cxx::tree::string Message-ID: <93498d8e048942c49fa49367c347394c@SXLOE207.fg.rbc.com> Hi, I'm in the process of updating the visual studio version for my team. We're moving from Visual Studio 2019 16.6 to Visual Studio 2019 16.11 however we encountered a problem. The issue is with linking: LNK2019 unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::erase(unsigned __int64,unsigned __int64)" (__imp_?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0@Z) referenced in function "protected: virtual int __cdecl std::basic_filebuf >::uflow(void)" (?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ) It's caused by using std::ifstream/std::ofstream/std::fstream together with xsd::cxx::tree::string (which inherits from std::basic_string) from Codesynthesis XSD library in Visual Studio higher than 16.6, e.g. 16.11.3. Minimal code to reproduce it (in a DLL project): #include #include typedef xsd::cxx::tree::type Type; typedef xsd::cxx::tree::simple_type SimpleType; template class __declspec(dllimport) xsd::cxx::tree::string; void f() { std::ifstream fs; } Could you please have a look see if you can reproduce and suggest a way to fix this. Thanks, Marek Krzynowek ______________________________________________________________________ This email is intended only for the use of the individual(s) to whom it is addressed and may be privileged and confidential. Unauthorised use or disclosure is prohibited. If you receive this e-mail in error, please advise immediately and delete the original message. This message may have been altered without your or our knowledge and the sender does not accept any liability for any errors or omissions in the message. Emails are monitored by supervisory personnel in jurisdictions where monitoring is permitted. Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. Please see link for RBCCM disclosures. https://www.rbccm.com/rbccm/policies-disclaimers.page From boris at codesynthesis.com Wed Sep 29 09:48:37 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Sep 29 09:46:57 2021 Subject: [xsd-users] Linker problem caused by using std::ifstream/std::ofstream/std::fstream together with xsd::cxx::tree::string In-Reply-To: <93498d8e048942c49fa49367c347394c@SXLOE207.fg.rbc.com> References: <93498d8e048942c49fa49367c347394c@SXLOE207.fg.rbc.com> Message-ID: Krzynowek, Marek (CWM-NR) writes: > template class __declspec(dllimport) xsd::cxx::tree::string; Can you elaborate on how you end up with this situation in your project (I have my suspicions but it would be helpful to clarify this).