From jamesbkoppel at yahoo.com Tue Sep 18 22:18:53 2012 From: jamesbkoppel at yahoo.com (James Koppel) Date: Tue Sep 18 22:19:01 2012 Subject: [xsd-users] On example code "Error: qualified name is not allowed" Message-ID: <1348021133.23445.YahooMailNeo@web164604.mail.gq1.yahoo.com> I attempted to compile the hello.xsd example. Visual Studio notes dozens of errors in the generated hello.cxx file of the form "qualified name is not allowed." An example is the following line: namespace xml_schema { ? ... ? typedef ::xsd::cxx::tree::simple_type< type > simple_type; ?... } How can I eliminate these errors? From jamesbkoppel at yahoo.com Wed Sep 19 04:02:41 2012 From: jamesbkoppel at yahoo.com (James Koppel) Date: Wed Sep 19 04:02:48 2012 Subject: [xsd-users] On example code "Error: qualified name is not allowed" In-Reply-To: <1348021133.23445.YahooMailNeo@web164604.mail.gq1.yahoo.com> References: <1348021133.23445.YahooMailNeo@web164604.mail.gq1.yahoo.com> Message-ID: <1348041761.98387.YahooMailNeo@web164601.mail.gq1.yahoo.com> I had simply incorrectly included the Xerces headers. Fixed. ________________________________ From: James Koppel To: "xsd-users@codesynthesis.com" Sent: Tuesday, September 18, 2012 7:18 PM Subject: [xsd-users] On example code "Error: qualified name is not allowed" I attempted to compile the hello.xsd example. Visual Studio notes dozens of errors in the generated hello.cxx file of the form "qualified name is not allowed." An example is the following line: namespace xml_schema { ? ... ? typedef ::xsd::cxx::tree::simple_type< type > simple_type; ?... } How can I eliminate these errors? From Arul.Prakash2 at rsa.com Fri Sep 21 06:27:39 2012 From: Arul.Prakash2 at rsa.com (Prakash, Arul) Date: Fri Sep 21 06:44:23 2012 Subject: [xsd-users] coverting xml_schema::string to std::string Message-ID: <0DB3CF5C512BBD4FA7E3A8ECD8FE7352123F4FB320@MX26A.corp.emc.com> Hi, How to convert xml_schema::string to std::string ? Thanks Arul -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7465 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20120921/41501bc9/smime.bin From boris at codesynthesis.com Fri Sep 21 13:45:42 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Sep 21 13:25:10 2012 Subject: [xsd-users] coverting xml_schema::string to std::string In-Reply-To: <0DB3CF5C512BBD4FA7E3A8ECD8FE7352123F4FB320@MX26A.corp.emc.com> References: <0DB3CF5C512BBD4FA7E3A8ECD8FE7352123F4FB320@MX26A.corp.emc.com> Message-ID: Hi Arul, Prakash, Arul writes: > How to convert xml_schema::string to std::string ? xml_schema::string derives from std::string so you can use an instance of this type anywhere std::string is expected. If you still want to get the value as std::string, then you can do: xml_schema::string s ("string"); std::string& r (s); Boris From Jaipal.Katkuri at itron.com Mon Sep 24 14:49:54 2012 From: Jaipal.Katkuri at itron.com (Katkuri, Jaipal) Date: Mon Sep 24 15:31:34 2012 Subject: [xsd-users] Build XSD on Linux Message-ID: <8E77780E66177E44BC77F3AE0187DA456CADA165@ITR-EXMBXVS-2.itron.com> Hi, I am following the steps from http://www.codesynthesis.com/projects/xsd/extras/build-unix.xhtml I am coming across some errors when I am running boost (boost_1_33_1) build instructions. To be more precise, when I execute "bjam -sTOOLS=gcc -sGXX=g++" I see "error: missing binary operator before token "("" at several places (ex. Bin.hpp, apply_wrap.hpp, etc.). The final output is ...failed FileClone /home/rjenny/Xerces1/boost_1_33_1/stage/lib/libboost_filesystem-gcc-1_33_1.so.1.33.1... ...failed updating 18 targets... ...skipped 8 targets... ...updated 17 targets... I don't know what's going on. I am new to Linux. Somebody please help me. Thanks Jaipal From boris at codesynthesis.com Mon Sep 24 16:03:35 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Sep 24 15:42:34 2012 Subject: [xsd-users] Build XSD on Linux In-Reply-To: <8E77780E66177E44BC77F3AE0187DA456CADA165@ITR-EXMBXVS-2.itron.com> References: <8E77780E66177E44BC77F3AE0187DA456CADA165@ITR-EXMBXVS-2.itron.com> Message-ID: Hi Jaipal, Katkuri, Jaipal writes: > I am coming across some errors when I am running boost (boost_1_33_1) > build instructions. To be more precise, when I execute "bjam -sTOOLS=gcc > -sGXX=g++" I see "error: missing binary operator before token "("" at > several places (ex. Bin.hpp, apply_wrap.hpp, etc.). I suspect you use a newer version of GCC that pick up some errors in Boost 1.33.1, which is quite old. Try a more recent version of Boost. Also make sure that you use xsd-3.3.0-2+dep package. > I am new to Linux. In this case you may want to consider using a pre-built XSD instead of trying to compile it yourself. Most major Linux distributions (e.g, Debian/Ubuntu, Fedora, RedHat EL, etc) have XSD packaged (the package name is usually xsdcxx). There are also pre-built packages available from the XSD Download page: http://www.codesynthesis.com/products/xsd/download.xhtml Boris From Wesley.Peters at tachyon.com Thu Sep 27 13:22:06 2012 From: Wesley.Peters at tachyon.com (Wesley Peters) Date: Fri Sep 28 03:28:21 2012 Subject: [xsd-users] Generated XML does not have full schema qualifiers Message-ID: Hi, I have a pair of simple programs attempting to communicate with each other using code generated by XSD. Program A creates a request, sends it to Program M, and waits for a reply. Program M receives the request, acts on it if it's understood, and replies -- basically an RPC. The problem I have is, when Program A creates the request, the generated XML is "qualified enough" for Program M to parse it. First, here's my xsd: Here's the request XML I hand created to test Program M: STEP 200 Here's the XML my Program A creates from the schema: STEP 200 Attempting to parse this in Program M one results in: antennaRequest0.xml:2:71 error: no declaration found for element 'p:RegisterCondition' antennaRequest0.xml:2:71 error: attribute '{http://www.w3.org/2000/xmlns/}p' is not declared for element 'p:RegisterCondition' antennaRequest0.xml:4:10 error: no declaration found for element 'topic' antennaRequest0.xml:6:13 error: no declaration found for element 'interval' I've edited the output, testing which of the 3 differences (encoding, standalone, and namesapces) seems to spur the problem, and it's in the lack of namespace. If I convert it to: STEP 200 Program M understands this document just fine: RegisterCondition: STEP @ 200 msec Here's the snippet from Program A where the "command" document is created, this is lifted straight from the Messaging driver program in the examples: std::auto_ptr req, res; modemCommand::registerCondition_t rc("STEP", 200); req.reset(new modemCommand::RegisterCondition(rc)); // Serialize the request to a DOM document. const XMLCh ls_id[] = { xercesc::chLatin_L, xercesc::chLatin_S, xercesc::chNull }; xercesc::DOMImplementation* impl(xercesc::DOMImplementationRegistry::getDOMImplementation(ls_id)); const std::string & name(req->_name()); const std::string & ns(req->_namespace()); xml_schema::dom::auto_ptr doc(impl->createDocument(xsd::cxx::xml::string(ns).c_str(), xsd::cxx::xml::string("p:" + name).c_str(), 0)); doc->setXmlStandalone(true); xml_schema::element_map::serialize(*doc->getDocumentElement(), *req); Breaking on the line where the document is created, we see: Breakpoint 1, main (argc=1, argv=0x7fff5fbff818) at antenna.cxx:60 60 0)); (gdb) p name.c_str() $1 = 0x100506418 "RegisterCondition" (gdb) p ns.c_str() $2 = 0x1005061d8 "http://schema.tachyon.com/modemCommand" As expected, the namespaceURI is "http://schema.tachyon.com/modemCommand" and the qualifiedName is "p:RegisterCondition". My question is, how do I add the additional namespace URIs to the document? Can the full list of namespace URIs be fetched from the XSD somehow? I assume the _name and _namespace in "req" come from my modemCommand::RegisterCondition object, which was created from the XSD, but the path to the additional namespaces isn't obvious from the examples or the doco I've seen so far. Thanks for any help you can offer. Wes Peters Confidentiality Notice: The information contained in this electronic e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and is confidential and/or privileged. If you and we have a confidentiality agreement or other non-disclosure obligations between us, this Notice shall be deemed to mark and identify the content of this email and any attachments as confidential and proprietary. If any reader of this communication is not the intended recipient, unauthorized use, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. IRS Circular 230 Disclosure: To ensure compliance with requirements imposed by the IRS, please be advised that any U.S. federal tax advice contained in this communication (including any attachments) is not intended or written to be used or relied upon, and cannot be used or relied upon, for the purpose of (i) avoiding penalties under the Internal Revenue Code, or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. E-mail is susceptible to data corruption, interception, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. From boris at codesynthesis.com Fri Sep 28 07:05:37 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Sep 28 06:43:39 2012 Subject: [xsd-users] Generated XML does not have full schema qualifiers In-Reply-To: References: Message-ID: Hi Wesley, Wesley Peters writes: > As expected, the namespaceURI is "http://schema.tachyon.com/modemCommand" > and the qualifiedName is "p:RegisterCondition". My question is, how do I > add the additional namespace URIs to the document? Those are not namespace URIs (well, only one of them is). What's missing in your case is the xsi:schemaLocation attribute (and the xsi prefix mapping). The second code example for the "How do I create an empty Xerces-C++ DOM document?" entry in the C++/Tree Mapping shows how to add them: http://wiki.codesynthesis.com/Tree/FAQ#How_do_I_create_an_empty_Xerces-C.2B.2B_DOM_document.3F Boris From Wesley.Peters at tachyon.com Fri Sep 28 16:30:34 2012 From: Wesley.Peters at tachyon.com (Wesley Peters) Date: Sun Sep 30 03:50:58 2012 Subject: [xsd-users] Generated XML does not have full schema qualifiers In-Reply-To: Message-ID: I actually figured this out in the shower this morning. It's nice to know that it's in the FAQ, too. My "fix" looks nearly identical to the linked FAQ entry, so I think I got it right. I have a follow-on question, though. Since the xsd has pretty much the same information encoded, i.e.: Does this information get dumped into the generated C++ object? I guess grep would answer that question for me. Since it's in the XSD, I'd rather be able to retrieve it "from" the XSD, rather than having to code it in two places. I should probably learn how to make this an actual standalone schema instead, right? On 9/28/12 4:05 AM, "Boris Kolpackov" wrote: Hi Wesley, Wesley Peters writes: > As expected, the namespaceURI is "http://schema.tachyon.com/modemCommand" > and the qualifiedName is "p:RegisterCondition". My question is, how do I > add the additional namespace URIs to the document? Those are not namespace URIs (well, only one of them is). What's missing in your case is the xsi:schemaLocation attribute (and the xsi prefix mapping). The second code example for the "How do I create an empty Xerces-C++ DOM document?" entry in the C++/Tree Mapping shows how to add them: http://wiki.codesynthesis.com/Tree/FAQ#How_do_I_create_an_empty_Xerces-C.2B.2B_DOM_document.3F Boris ________________________________ Confidentiality Notice: The information contained in this electronic e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and is confidential and/or privileged. If you and we have a confidentiality agreement or other non-disclosure obligations between us, this Notice shall be deemed to mark and identify the content of this email and any attachments as confidential and proprietary. If any reader of this communication is not the intended recipient, unauthorized use, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. IRS Circular 230 Disclosure: To ensure compliance with requirements imposed by the IRS, please be advised that any U.S. federal tax advice contained in this communication (including any attachments) is not intended or written to be used or relied upon, and cannot be used or relied upon, for the purpose of (i) avoiding penalties under the Internal Revenue Code, or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. E-mail is susceptible to data corruption, interception, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.