From landa.martin at gmail.com Fri Jan 8 10:12:18 2016 From: landa.martin at gmail.com (Martin Landa) Date: Fri Jan 8 10:12:25 2016 Subject: [xsd-users] how to parse class attributes and data types Message-ID: Hi all, I am total newbie in XSD parsing world, so sorry in advance for beginner questions. Basically I am trying to write a program which reads XML file and prints information about xsd class attributes and their data types. Relevant generated part of the parser skeleton is here [1]. The XML input can look like: My program should print: 1) number of items - in this case 2 2) and item attributes and their types (based on xsd definition). id -> participantIdAttrType jm -> stringType pr -> stringType ... psc -> postCodeType Is it possible? Thanks in advance for any kind of pointers! Martin [1] http://geo102.fsv.cvut.cz/~landa/tmp/vfp_3.1-pskel.h -- Martin Landa http://geo.fsv.cvut.cz/gwiki/Landa http://gismentors.cz/mentors/landa From boris at codesynthesis.com Mon Jan 11 09:56:14 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jan 11 09:55:50 2016 Subject: [xsd-users] unable to write new fields to XML file In-Reply-To: References: Message-ID: Hi Aciel, Aciel Eshky writes: > If possible, I'd still like to understand why it wasn't working properly > before. In my xsd options, I was previously using the namespace mapping and > it was working properly as far as input xml files are concered. Perhaps I > was missing something similar for the output? Your porblem sounds rather strange so instead of trying to guess what could have gone wrong, I would suggest that you take the 'library' example (which uses XML namespaces) and see if you can modify it to reproduce your problem. When/if you can do it, send it along, and I will take a look. Boris From boris at codesynthesis.com Mon Jan 11 10:05:18 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jan 11 10:04:55 2016 Subject: [xsd-users] how to parse class attributes and data types In-Reply-To: References: Message-ID: Hi Martin, Martin Landa writes: > Basically I am trying to write a program which reads XML file and prints > information about xsd class attributes and their data types. > My program should print: > > 1) number of items - in this case 2 > 2) and item attributes and their types (based on xsd definition). > id -> participantIdAttrType > jm -> stringType > pr -> stringType > ... > psc -> postCodeType XSD's primary goal is to generate a C++ object model based on the XML Schema which can then be used to load the corresponding XML documents. As such, it doesm't retain any information about XML Schema in C++ (for 99% of the applications that would be an unnecessary bloat). There is (probably) a way to achieve what you want: the C++ object model can be optionally associated with the underlying Xerces-C++ DOM nodes. And Xerces-C++ DOM nodes can be optionally associated with what is called Post-Schema Validation Infoset (PSVI) which is essentially the XML Schema "fragment" (e.g., a type) that was used to validate this XML fragment. This is all fairly complicated (especially working with Xerces-C++ PSVI) and really outside the main use of XSD (in fact, chances are, you are better off with pure Xerces-C++). So if you want to go this route, you will have to figure all this out yourself. Good luck. Boris From dario.luzzi at qmap.it Mon Jan 18 11:30:02 2016 From: dario.luzzi at qmap.it (Dario Luzzi) Date: Mon Jan 18 11:33:45 2016 Subject: [xsd-users] parser expat compilation error Message-ID: <569D130A.2010508@qmap.it> Hi all, I just discovered xsd tool and started looking at it. Starting with a xsd document and the xsd tool I created the parser skeleton using expat libraries. Now, I tried compiling the skeleton but I'm getting a ton of errors like this: In file included from /usr/include/xsd/cxx/parser/expat/elements.hxx:360:0, from DATEXIISchema_1_0_1_0-pskel.hxx:451, from DATEXIISchema_1_0_1_0-pskel.cxx:41: /usr/include/xsd/cxx/parser/expat/elements.txx: In member function ?bool xsd::cxx::parser::expat::document::parse(std::istream&, const std::basic_string<_CharT>*, const std::basic_string<_CharT>*, xsd::cxx::xml::error_handler&)?: /usr/include/xsd/cxx/parser/expat/elements.txx:282:22: error: no match for ?operator==? (operand types are ?xsd::cxx::parser::expat::parser_auto_ptr? and ?int?) if (parser == 0) ^ /usr/include/xsd/cxx/parser/expat/elements.txx:282:22: note: candidates are: In file included from /usr/include/xsd/cxx/parser/xml-schema.hxx:569:0, from DATEXIISchema_1_0_1_0-pskel.hxx:446, from DATEXIISchema_1_0_1_0-pskel.cxx:41: /usr/include/xsd/cxx/parser/xml-schema.txx:15:7: note: template bool xsd::cxx::parser::operator==(const xsd::cxx::parser::string_sequence&, const xsd::cxx::parser::string_sequence&) operator== (const string_sequence& a, const string_sequence& b) ^ any idea what's wrong? From kcheung at aehr.com Mon Jan 18 21:37:13 2016 From: kcheung at aehr.com (Ken Cheung) Date: Mon Jan 18 21:37:22 2016 Subject: [xsd-users] 'DOMDocument' : ambiguous symbol Message-ID: Hello, I am having the following compiler error when using Microsoft Visual Studio 2013. C2872: 'DOMDocument' : ambiguous symbol c:\program files (x86)\codesynthesis xsd 4.0\include\xsd\cxx\tree\serialization.txx 104 1 TestXSD2 Currently I am using 4.0 that has this problem. Do you have a newer version like xsd-4.1.msi to fix this problem? If not, do you have any precompiled library for Windows. Thank you! Ken From boris at codesynthesis.com Tue Jan 19 10:52:01 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jan 19 10:52:02 2016 Subject: [xsd-users] 'DOMDocument' : ambiguous symbol In-Reply-To: References: Message-ID: Hi Ken, Ken Cheung writes: > C2872: 'DOMDocument' : ambiguous symbol [...] This is a known bug that has been fixed for the next release: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=a066f175060a6ada5c60c378ca4dab6e9b571e35 > Currently I am using 4.0 that has this problem. Do you have a newer > version like xsd-4.1.msi If not, do you have any precompiled library > for Windows. The above link contains a patch which you can apply to XSD 4.0.0. There is also the 4.1.0 pre-release but not as .msi: http://codesynthesis.com/~boris/tmp/xsd/xsd-4.1.0.a7-i686-windows.zip Boris From boris at codesynthesis.com Tue Jan 19 10:54:46 2016 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jan 19 10:54:46 2016 Subject: [xsd-users] parser expat compilation error In-Reply-To: <569D130A.2010508@qmap.it> References: <569D130A.2010508@qmap.it> Message-ID: Hi Dario, Dario Luzzi writes: > /usr/include/xsd/cxx/parser/expat/elements.txx:282:22: error: no > match for ?operator==? (operand types are > ?xsd::cxx::parser::expat::parser_auto_ptr? and ?int?) > if (parser == 0) This is a known bug that has been fixed for the next release: http://scm.codesynthesis.com/?p=xsd/xsd.git;a=commit;h=94cba986108a0e0f42295572ca42c356d59328d7 There is a small patch at the above link that you can apply. Boris