From jgross03 at harris.com Tue Apr 4 15:36:59 2017 From: jgross03 at harris.com (Gross, Jeffrey) Date: Tue Apr 4 15:37:12 2017 Subject: [xsd-users] serialization of any elements and namespaces Message-ID: <370161033c704dc8ad991e5ff25a13c4@ROCXCH14.cs.myharris.net> Hello, I'm trying to add an element to the "any sequence" of another element and I see namespaces appear in the serialized code where I don't want/need them. For example my code snippet: groupType groupElement; groupElement.name("group1"); statusType statusElement; xercesc::DOMElement* e = statusElement.dom_document().createElement(xsd::cxx::xml::string("ns2:group")); *e << groupElement; statusElement.any().push_back(e); eventually generates an XML snippet that looks like: I would like to get rid of that xmlns="" bit. I found a previous post that seemed to indicate this would be fixed: >From http://codesynthesis.com/pipermail/xsd-users/2012-March/003558.html: > This is a Xerces-C++ limitation that we are planning to fix for the next > release (i.e., allow serialization of an XML fragment as if it was in > a context of some outer element). For now, depending on how your schema, > uses XML namespaces, you may have to live with some extra namespace > information Am I doing something wrong? Is this fixed now? If not, will it be? Thanks, Jeff From boris at codesynthesis.com Wed Apr 5 12:37:29 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Apr 5 12:37:39 2017 Subject: [xsd-users] serialization of any elements and namespaces In-Reply-To: <370161033c704dc8ad991e5ff25a13c4@ROCXCH14.cs.myharris.net> References: <370161033c704dc8ad991e5ff25a13c4@ROCXCH14.cs.myharris.net> Message-ID: Hi Jeffrey, Gross, Jeffrey writes: > xercesc::DOMElement* e = > statusElement.dom_document().createElement( > xsd::cxx::xml::string("ns2:group")); Try to create the element with the actual namespace URI and createElementNS() instead of using a name with the namespace prefix. Boris From acchavanabhi at gmail.com Wed Apr 12 09:37:52 2017 From: acchavanabhi at gmail.com (Abhijeet Chavan) Date: Wed Apr 12 09:38:04 2017 Subject: [xsd-users] XSD Installation on Ubuntu Message-ID: Hello Sir/Madam, I have to convert XML code into executable C++ code. for that I need to install Code Synthesis XSD into Ubuntu. I need help , how to install and use XSD for my project. Thank You Abhi From gschrad at ll.mit.edu Wed Apr 19 17:46:25 2017 From: gschrad at ll.mit.edu (Schrader, Glenn - 1002 - MITLL) Date: Wed Apr 19 17:46:39 2017 Subject: [xsd-users] xsd compiler question about the --file-per-type option Message-ID: <27DDD3411B05CA45AD0BFA16D8657AD938B5D977@LLE2K10-MBX02.mitll.ad.local> I have a hopefully simple question: I have an xsd file with a number of root elements and I'm using -generate-serialization to create the corresponding parser and serialization functions. That all works fine. In the end I'll wind up with a huge schema so I'd like to use -file-per-type so that each application module only needs to #include the small header(s) for the type(s) it cares about. The issue is that when I use -file-per-type the type definitions are placed in separate header files as I expected but all of the parser and serialization functions are placed into the .hxx header (for a schema file named ".xsd"). I would have expected the parser and serialization function prototypes to also be in the same header as the type definition rather than in the common header that #includes everything. Is there some way to tell the compiler to include those definitions in their corresponding type headers? I didn't seen an obvious compiler parameter that looked relevant. Thanks, Glenn Schrader -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5471 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20170419/a4aa9351/smime.bin From boris at codesynthesis.com Thu Apr 20 12:18:59 2017 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Apr 20 12:19:10 2017 Subject: [xsd-users] xsd compiler question about the --file-per-type option In-Reply-To: <27DDD3411B05CA45AD0BFA16D8657AD938B5D977@LLE2K10-MBX02.mitll.ad.local> References: <27DDD3411B05CA45AD0BFA16D8657AD938B5D977@LLE2K10-MBX02.mitll.ad.local> Message-ID: Hi Glenn, Schrader, Glenn - 1002 - MITLL writes: > The issue is that when I use -file-per-type the type definitions are placed > in separate header files as I expected but all of the parser and > serialization functions are placed into the .hxx header (for a schema > file named ".xsd"). I would have expected the parser and serialization > function prototypes to also be in the same header as the type definition > rather than in the common header that #includes everything. > > Is there some way to tell the compiler to include those definitions in their > corresponding type headers? I didn't seen an obvious compiler parameter that > looked relevant. See the --fat-type-file option. Boris From gschrad at ll.mit.edu Mon Apr 24 08:54:30 2017 From: gschrad at ll.mit.edu (Schrader, Glenn - 1002 - MITLL) Date: Mon Apr 24 08:54:44 2017 Subject: [xsd-users] xsd compiler question about the --file-per-type option In-Reply-To: References: <27DDD3411B05CA45AD0BFA16D8657AD938B5D977@LLE2K10-MBX02.mitll.ad.local> Message-ID: <27DDD3411B05CA45AD0BFA16D8657AD938B5E6A2@LLE2K10-MBX02.mitll.ad.local> Thanks, that is what I was missing. --glenn -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Thursday, April 20, 2017 12:19 PM To: Schrader, Glenn - 1002 - MITLL Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] xsd compiler question about the --file-per-type option Hi Glenn, Schrader, Glenn - 1002 - MITLL writes: > The issue is that when I use -file-per-type the type definitions are > placed in separate header files as I expected but all of the parser > and serialization functions are placed into the .hxx header (for > a schema file named ".xsd"). I would have expected the parser and > serialization function prototypes to also be in the same header as the > type definition rather than in the common header that #includes everything. > > Is there some way to tell the compiler to include those definitions in > their corresponding type headers? I didn't seen an obvious compiler > parameter that looked relevant. See the --fat-type-file option. Boris -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5471 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20170424/da4d4071/smime.bin