From paul.s.mcgrath at gmail.com Thu Sep 8 06:18:25 2022 From: paul.s.mcgrath at gmail.com (Paul McGrath) Date: Thu Sep 8 06:21:03 2022 Subject: [xsd-users] Saving Partial XSD trees Message-ID: I'm looking to save sequences without requiring having to save the whole tree. The rationale behind this is to create a library of elements that can be then cloned into a tree. Regards, Paul From hoppef at hsu-hh.de Fri Sep 9 10:40:58 2022 From: hoppef at hsu-hh.de (Felix Hoppe) Date: Fri Sep 9 12:39:34 2022 Subject: [xsd-users] Compilation error with xsd:decimal mapped to long double Message-ID: <78f7c549-d2a6-5b06-bd31-cff7779e24a1@hsu-hh.de> Hallo, I have the following problem: I tried to re-map the decimal type to "long double", as it is described for example in this mail https://www.codesynthesis.com/pipermail/xsd-users/2008-June/001776.html However, now when I try to compile my code I get three error messages. Some excerpts of the errors (for errors 2 and 3 I omitted text for the sake of brevity): /home/felix/Programming/ls1-mardyn/dependencies-external/libxsd/xsd/cxx/tree/parsing.txx:307:19: error: no matching member function for call to 'push_back' ??????????? this->push_back ( ??????????? ~~~~~~^~~~~~~~~ /home/felix/Programming/ls1-mardyn/dependencies-external/libxsd/xsd/cxx/tree/parsing.txx:263:9: note: in instantiation of member function 'xsd::cxx::tree::list::init' requested here ??????? init (tree::text_content (e), &e); ??????? ^ /home/felix/Programming/ls1-mardyn/src/io/vtk/vtk-unstructured.cpp:480:3: note: in instantiation of member function 'xsd::cxx::tree::list::list' requested here ? ::xsd::cxx::tree::list< ::xml_schema::decimal, char, ::xsd::cxx::tree::schema_type::decimal > (e, f, this) ? ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:1187:7: note: candidate function not viable: no known conversion from 'std::unique_ptr' to 'const std::vector >::value_type' (aka 'const long double') for 1st argument ????? push_back(const value_type& __x) ????? ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:1203:7: note: candidate function not viable: no known conversion from 'std::unique_ptr' to 'std::vector >::value_type' (aka 'long double') for 1st argument ????? push_back(value_type&& __x) Warning 2: /libxsd/xsd/cxx/tree/elements.hxx:1509:39: error: excess elements in scalar initializer ????????? return XSD_AUTO_PTR (new T (s, e, f, c)); ????????????????????????????????????? ^?? ~~~~~~~~~ Warning 3: /libxsd/xsd/cxx/tree/serialization.txx:226:14: error: invalid operands to binary expression ('list_stream' and 'as_decimal') ????????? ls << as_decimal (*i); ????????? ~~ ^? ~~~~~~~~~~~~~~~~~~ The xsdcxx version is 4.0.0, libxerces-c is 3.2.3. Tried different compilers like clang 10 or gcc 8.5 or 9. Hopefully someone can help. Thanks in advance, Felix From boris at codesynthesis.com Sun Sep 11 07:39:00 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Sep 11 07:33:39 2022 Subject: [xsd-users] Saving Partial XSD trees In-Reply-To: References: Message-ID: Paul McGrath writes: > I'm looking to save sequences without requiring having to save the whole > tree. The rationale behind this is to create a library of elements that can > be then cloned into a tree. Each XML Schema type is mapped to a C++ class that comes with a parsing constructor (from DOMElement) and a serialization operator<< (to DOMElement). So with some effort (i.e., create suitable DOMElement, etc) you should be able to serialize a sequence of instances of such classes. The closest example to what you are trying to achieve is probably cxx/tree/messaging/ (it also comes with DOM parsing/serialization helpers which you will most likely find useful). There is also cxx/tree/streaming/ that you may find relevant. From boris at codesynthesis.com Sun Sep 11 07:50:17 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Sep 11 07:44:52 2022 Subject: [xsd-users] Compilation error with xsd:decimal mapped to long double In-Reply-To: <78f7c549-d2a6-5b06-bd31-cff7779e24a1@hsu-hh.de> References: <78f7c549-d2a6-5b06-bd31-cff7779e24a1@hsu-hh.de> Message-ID: Felix Hoppe writes: > I have the following problem: I tried to re-map the decimal type to "long > double", as it is described for example in this mail > https://www.codesynthesis.com/pipermail/xsd-users/2008-June/001776.html Hm, that email doesn't actually describe how to do that, it just points to the cxx/tree/custom/double example which in turn refers (from its README) to: http://wiki.codesynthesis.com/Tree/Customization_guide In this case, we are interested in Section 5, "Customizing the XML Schema built-in types". > However, now when I try to compile my code I get three error messages. I believe some of the steps described in the above example/guide are missing. Can you describe exactly what you have done and also show your traits specialization for the xs:decimal to C++ long double mapping? From hoppef at hsu-hh.de Mon Sep 12 05:17:50 2022 From: hoppef at hsu-hh.de (Felix Hoppe) Date: Mon Sep 12 06:40:02 2022 Subject: [xsd-users] Compilation error with xsd:decimal mapped to long double In-Reply-To: References: <78f7c549-d2a6-5b06-bd31-cff7779e24a1@hsu-hh.de> Message-ID: Am 11.09.22 um 13:50 schrieb Boris Kolpackov: > Hm, that email doesn't actually describe how to do that, it just points > to the cxx/tree/custom/double example which in turn refers (from its > README) to: > > http://wiki.codesynthesis.com/Tree/Customization_guide > > In this case, we are interested in Section 5, "Customizing the XML Schema > built-in types". Yes, I actually followed this example, which I found in one of the mails: http://www.codesynthesis.com/~boris/tmp/custom-double.zip > I believe some of the steps described in the above example/guide are > missing. Can you describe exactly what you have done and also show your > traits specialization for the xs:decimal to C++ long double mapping? Hence, what I did are the following steps (with some minor modifications like --hxx-suffix .h --cxx-suffix .cpp): /xsdcxx cxx-tree --std c++11 --generate-serialization --generate-xml-schema? --hxx-suffix .h --cxx-suffix .cpp --custom-type double=double --custom-type "decimal=long double" --hxx-epilogue-file xml-schema-epilogue.h xml-schema.xsd/ /xsdcxx cxx-tree --std c++11 --root-element-last? --hxx-suffix .h --cxx-suffix .cpp --extern-xml-schema xml-schema.xsd --generate-serialization vtk-unstructured.xsd/ /xsdcxx cxx-tree --std c++11 --root-element-last? --hxx-suffix .h --cxx-suffix .cpp --extern-xml-schema xml-schema.xsd --generate-serialization vtk-punstructured.xsd/ Here, the 'xml-schema-epilogue.h' is exactly the same as found in 'custom-double.zip'. Also the files 'decimal.h', 'decimal-parsing.h', 'decimal-serialization.h', 'double-parsing.h' and 'double-serialization.h' are unchanged except from changing the extension. From boris at codesynthesis.com Mon Sep 12 06:56:45 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Sep 12 06:51:22 2022 Subject: [xsd-users] Compilation error with xsd:decimal mapped to long double In-Reply-To: References: <78f7c549-d2a6-5b06-bd31-cff7779e24a1@hsu-hh.de> Message-ID: Felix Hoppe writes: > Yes, I actually followed this example, which I found in one of the mails: > > http://www.codesynthesis.com/~boris/tmp/custom-double.zip That example was written for XSD 3.X.Y-series and things have changed a bit in XSD 4.X.Y. But you should be able to adjust it using the current cxx/tree/example/custom/double example as a reference: https://git.codesynthesis.com/cgit/xsd/xsd/tree/xsd-examples/cxx/tree/custom/double From manuel at rightlight.es Mon Sep 12 07:27:19 2022 From: manuel at rightlight.es (manuel@rightlight.es) Date: Mon Sep 12 07:22:10 2022 Subject: [xsd-users] Compilation error with xsd:decimal mapped to long double In-Reply-To: References: <78f7c549-d2a6-5b06-bd31-cff7779e24a1@hsu-hh.de> Message-ID: <0ed3d017-8e14-b71b-550f-d03de93e2ef8@rightlight.es> unsuscribe On 12/9/22 12:56, Boris Kolpackov wrote: > Felix Hoppe writes: > > > Yes, I actually followed this example, which I found in one of the mails: > > > > http://www.codesynthesis.com/~boris/tmp/custom-double.zip > > That example was written for XSD 3.X.Y-series and things have changed > a bit in XSD 4.X.Y. But you should be able to adjust it using the > current cxx/tree/example/custom/double example as a reference: > > https://git.codesynthesis.com/cgit/xsd/xsd/tree/xsd-examples/cxx/tree/custom/double > > From paul.s.mcgrath at gmail.com Mon Sep 12 08:19:57 2022 From: paul.s.mcgrath at gmail.com (Paul McGrath) Date: Tue Sep 13 04:58:48 2022 Subject: [xsd-users] Saving Partial XSD trees In-Reply-To: References: Message-ID: Thanks, I appreciate it. It will take me a while to get through understanding the suggested examples, but I will get back to you on how it progresses. On Sun, Sep 11, 2022 at 7:39 AM Boris Kolpackov wrote: > Paul McGrath writes: > > > I'm looking to save sequences without requiring having to save the whole > > tree. The rationale behind this is to create a library of elements that > can > > be then cloned into a tree. > > Each XML Schema type is mapped to a C++ class that comes with a > parsing constructor (from DOMElement) and a serialization operator<< > (to DOMElement). So with some effort (i.e., create suitable DOMElement, > etc) you should be able to serialize a sequence of instances of such > classes. > > The closest example to what you are trying to achieve is probably > cxx/tree/messaging/ (it also comes with DOM parsing/serialization > helpers which you will most likely find useful). There is also > cxx/tree/streaming/ that you may find relevant. > From hoppef at hsu-hh.de Fri Sep 16 09:19:21 2022 From: hoppef at hsu-hh.de (Felix Hoppe) Date: Fri Sep 16 09:17:38 2022 Subject: [xsd-users] Compilation error with xsd:decimal mapped to long double In-Reply-To: References: <78f7c549-d2a6-5b06-bd31-cff7779e24a1@hsu-hh.de> Message-ID: Thank you very much! Worked like a charm! Am 12.09.22 um 12:56 schrieb Boris Kolpackov: > Felix Hoppe writes: > >> Yes, I actually followed this example, which I found in one of the mails: >> >> http://www.codesynthesis.com/~boris/tmp/custom-double.zip > That example was written for XSD 3.X.Y-series and things have changed > a bit in XSD 4.X.Y. But you should be able to adjust it using the > current cxx/tree/example/custom/double example as a reference: > > https://git.codesynthesis.com/cgit/xsd/xsd/tree/xsd-examples/cxx/tree/custom/double -- -- Dr. Felix Hoppe -- Chair for High Performance Computing -- Helmut-Schmidt-Universit?t Hamburg -- Holstenhofweg 85/ Postfach 70 08 22 -- 22043 Hamburg/Germany -- -- Phone: +49 40 6541-2979 -- E-mail: hoppef@hsu-hh.de -- URL: www.hsu-hh.de/hpc --