From jeroen.vrijnsen at philips.com Thu Feb 9 04:53:03 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Thu Feb 9 04:53:19 2017
Subject: [xsde-users] Empty cpp generated depending on location of type
definition
Message-ID: <6b8602596f264e15a39d467e5de96527@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Hi,
I have the following XSD schemas:
LrimResponseSchema.xsd:
-->
And LrCommonDataTypesSchema.xsd:
When I generated code for LrimResponseSchema.xsd, using
$XSDE cxx-hybrid \
--generate-parser \
--generate-serializer \
--generate-aggregate \
--generate-polymorphic \
--char-encoding utf8 \
--root-element-first \
--hxx-suffix .h \
--cxx-suffix .cpp \
--namespace-map = ::xsdegeneratedcode::xml \
--output-dir components/xsdegeneratedcode/target/generated_source \
components/xsdegeneratedcode/source/LrimResponseSchema.xsd
the resulting LrimResponseSchema.cpp has no content other than namespace declarations. However, when I update LrimResponseSchema.xsd to inline the type-defintion of LrimType (commented block in above sample),
correct code is generated.
What can I do to have correct code generated for the situation where LrimType is declared in the separate XSD file (as it's used somewhere else as well)??
Kind regards,
Jeroen Vrijnsen
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From boris at codesynthesis.com Thu Feb 9 11:50:44 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Thu Feb 9 11:50:52 2017
Subject: [xsde-users] Empty cpp generated depending on location of type
definition
In-Reply-To: <6b8602596f264e15a39d467e5de96527@DB5PR9003MB0247.MGDPHG.emi.philips.com>
References: <6b8602596f264e15a39d467e5de96527@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Message-ID:
Hi Jeroen,
Vrijnsen, Jeroen writes:
> LrimResponseSchema.xsd:
> [...]
>
> And LrCommonDataTypesSchema.xsd:
> [...]
>
> When I generated code for LrimResponseSchema.xsd, using
> $XSDE cxx-hybrid \
> --generate-parser \
> --generate-serializer \
> --generate-aggregate \
> --generate-polymorphic \
> --char-encoding utf8 \
> --root-element-first \
> --hxx-suffix .h \
> --cxx-suffix .cpp \
> --namespace-map = ::xsdegeneratedcode::xml \
> --output-dir components/xsdegeneratedcode/target/generated_source \
> components/xsdegeneratedcode/source/LrimResponseSchema.xsd
>
> the resulting LrimResponseSchema.cpp has no content other than
> namespace declarations. However, when I update LrimResponseSchema.xsd
> to inline the type-defintion of LrimType (commented block in above sample),
> correct code is generated. What can I do to have correct code generated
> for the situation where LrimType is declared in the separate XSD file
> (as it's used somewhere else as well)??
If you look inside LrimResponseSchema.h you will notice that it #include's
LrCommonDataTypesSchema.h, that is, XSD/e maps schema include/import to
C++ include. So all you need to do is also compile LrCommonDataTypesSchema.xsd
and include the resulting generated C++ files into your project.
Boris
From jeroen.vrijnsen at philips.com Thu Feb 9 13:53:21 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Thu Feb 9 13:53:36 2017
Subject: [xsde-users] Empty cpp generated depending on location of type
definition
In-Reply-To:
References: <6b8602596f264e15a39d467e5de96527@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Message-ID: <4d3b2f181de54b20ba2f5d4a8707471d@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Hi Boris,
Thanks for the quick reply. It does not solve the issue, unfortunately, as I actually am also generating code from LrCommonDataTypes.xsd.
To be clear, this is the content of my LrimResponseSchema.h:
#ifndef CPP_COMPONENTS_XSDEGENERATEDCODE_SOURCE_LRIM_RESPONSE_SCHEMA_H
#define CPP_COMPONENTS_XSDEGENERATEDCODE_SOURCE_LRIM_RESPONSE_SCHEMA_H
#include
#if (XSDE_INT_VERSION != 3020000L)
#error XSD/e runtime version mismatch
#endif
#include
#ifndef XSDE_ENCODING_UTF8
#error the generated code uses the UTF-8 encodingwhile the XSD/e runtime does not (reconfigure the runtime or change the --char-encoding value)
#endif
#ifndef XSDE_STL
#error the generated code uses STL while the XSD/e runtime does not (reconfigure the runtime or add --no-stl)
#endif
#ifndef XSDE_EXCEPTIONS
#error the generated code uses exceptions while the XSD/e runtime does not (reconfigure the runtime or add --no-exceptions)
#endif
#ifndef XSDE_LONGLONG
#error the generated code uses long long while the XSD/e runtime does not (reconfigure the runtime or add --no-long-long)
#endif
#ifdef XSDE_CUSTOM_ALLOCATOR
#error the XSD/e runtime uses custom allocator while the generated code does not (reconfigure the runtime or add --custom-allocator)
#endif
#include
// Begin prologue.
//
//
// End prologue.
#include
#include
#include
namespace xml_schema
{
// .... many typedefs and usings.
}
namespace sgse
{
namespace xsdegeneratedcode
{
namespace xml
{
}
}
}
#include "LrCommonDataTypesSchema.h"
namespace sgse
{
namespace xsdegeneratedcode
{
namespace xml
{
}
}
}
// Begin epilogue.
//
//
// End epilogue.
#include
#endif // CPP_COMPONENTS_XSDEGENERATEDCODE_SOURCE_LRIM_RESPONSE_SCHEMA_H
Which is pretty empty... In my code using the LrimResponseSchema.h, I except to find a ::sgse::xsdegeneratedcode::xml::LrimResponse object, but that clearly is not there...
-Jeroen
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From boris at codesynthesis.com Fri Feb 10 10:49:55 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Fri Feb 10 10:50:04 2017
Subject: [xsde-users] Empty cpp generated depending on location of type
definition
In-Reply-To: <4d3b2f181de54b20ba2f5d4a8707471d@DB5PR9003MB0247.MGDPHG.emi.philips.com>
References: <6b8602596f264e15a39d467e5de96527@DB5PR9003MB0247.MGDPHG.emi.philips.com>
<4d3b2f181de54b20ba2f5d4a8707471d@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Message-ID:
Hi Jeroen,
Vrijnsen, Jeroen writes:
> #include "LrCommonDataTypesSchema.h"
Here it is: this header defines LrimType.
> Which is pretty empty... In my code using the LrimResponseSchema.h,
> I except to find a ::sgse::xsdegeneratedcode::xml::LrimResponse object,
> but that clearly is not there...
LrimResponse is an element in the schema which is mapped to a pair of
parsers/serializers, not object model classes. Take a look into
*-pimpl/*-simpl files.
Boris
From jeroen.vrijnsen at philips.com Mon Feb 13 01:13:56 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Mon Feb 13 01:14:12 2017
Subject: [xsde-users] Empty cpp generated depending on location of type
definition
In-Reply-To:
References: <6b8602596f264e15a39d467e5de96527@DB5PR9003MB0247.MGDPHG.emi.philips.com>
<4d3b2f181de54b20ba2f5d4a8707471d@DB5PR9003MB0247.MGDPHG.emi.philips.com>,
Message-ID: <77eb2f8f5aaa497f8d09c81cad4dcaca@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Hi Boris,
Thanks, you're right. The part I was missing is, that for the other adapters I was writing, the serialization class was named after the root-element; for this particular case, it is indeed named after the element type, which is part of the LrCommonDataTypesSchema!
Thank you!
Regards,
Jeroen
________________________________
From: Boris Kolpackov
Sent: Friday, February 10, 2017 4:49:55 PM
To: Vrijnsen, Jeroen
Cc: xsde-users@codesynthesis.com
Subject: Re: [xsde-users] Empty cpp generated depending on location of type definition
Hi Jeroen,
Vrijnsen, Jeroen writes:
> #include "LrCommonDataTypesSchema.h"
Here it is: this header defines LrimType.
> Which is pretty empty... In my code using the LrimResponseSchema.h,
> I except to find a ::sgse::xsdegeneratedcode::xml::LrimResponse object,
> but that clearly is not there...
LrimResponse is an element in the schema which is mapped to a pair of
parsers/serializers, not object model classes. Take a look into
*-pimpl/*-simpl files.
Boris
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From jeroen.vrijnsen at philips.com Wed Feb 15 01:57:11 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Wed Feb 15 01:57:27 2017
Subject: [xsde-users] Code generation fails for restricted list type
Message-ID:
Hi,
Based on the XSDe 3.2.0 "hybrid list test", I have created the following schema (I have just updated the existing sample code):
and corresponding XML file:
0.0 0.1
When I now compile the test, I get the following error:
test-pimpl.cxx: In constructor 'test::root_paggr::root_paggr()':
test-pimpl.cxx:209:52: error: expected unqualified-id before ')' token
this->restricted_double_list_p_.parsers (this->);
I.e., code generation fails!!
How can this be resolved?
Kind regards,
Jeroen Vrijnsen
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From boris at codesynthesis.com Wed Feb 15 11:32:12 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Wed Feb 15 11:32:21 2017
Subject: [xsde-users] Code generation fails for restricted list type
In-Reply-To:
References:
Message-ID:
Hi Jeroen,
Vrijnsen, Jeroen writes:
> When I now compile the test, I get the following error:
>
> test-pimpl.cxx: In constructor 'test::root_paggr::root_paggr()':
> test-pimpl.cxx:209:52: error: expected unqualified-id before ')' token
> this->restricted_double_list_p_.parsers (this->);
I tried your test and it works on current master. Can you try this
pre-release binary:
http://codesynthesis.com/~boris/tmp/xsde/xsde-3.3.0.a8-x86_64-linux-gnu.tar.bz2
Thanks,
Boris
From jeroen.vrijnsen at philips.com Thu Feb 16 02:51:14 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Thu Feb 16 02:51:28 2017
Subject: [xsde-users] Code generation fails for restricted list type
In-Reply-To:
References:
Message-ID: <2236e9204ba2452baed0073405ccc810@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Hi Boris,
Thanks. But the archive seems to be incomplete: I need to rebuild because I need polymorphism to be enabled, and it seems to be missing an install-sh..
Regards,
Jeroen
-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com]
Sent: 2017 Feb 15 5:32 PM
To: Vrijnsen, Jeroen
Cc: xsde-users@codesynthesis.com
Subject: Re: [xsde-users] Code generation fails for restricted list type
Hi Jeroen,
Vrijnsen, Jeroen writes:
> When I now compile the test, I get the following error:
>
> test-pimpl.cxx: In constructor 'test::root_paggr::root_paggr()':
> test-pimpl.cxx:209:52: error: expected unqualified-id before ')' token
> this->restricted_double_list_p_.parsers (this->);
I tried your test and it works on current master. Can you try this pre-release binary:
http://codesynthesis.com/~boris/tmp/xsde/xsde-3.3.0.a8-x86_64-linux-gnu.tar.bz2
Thanks,
Boris
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From jeroen.vrijnsen at philips.com Thu Feb 16 04:23:33 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Thu Feb 16 04:23:49 2017
Subject: [xsde-users] Feature request: validate empty xs:base64binary element
Message-ID:
Hi,
I have the following XML schema:
When I try to validate the following XML:
TheName
What I want to say
It is reported as being invalid, as base64-binary element is empty. However, the XSD standard allows this (although vague about it).
I have made a local patch to libxsde\xsde\cxx\parser\validating\base64-binary.cxx, but it might be interesting to add this feature to the code base. Is it possible to do such a request, and if so, is there a timeline by which a new release will be available?
Kind regards,
Jeroen Vrijnsen
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From boris at codesynthesis.com Thu Feb 16 11:37:22 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Thu Feb 16 11:37:31 2017
Subject: [xsde-users] Code generation fails for restricted list type
In-Reply-To: <2236e9204ba2452baed0073405ccc810@DB5PR9003MB0247.MGDPHG.emi.philips.com>
References:
<2236e9204ba2452baed0073405ccc810@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Message-ID:
Hi Jeroen,
Vrijnsen, Jeroen writes:
> But the archive seems to be incomplete: I need to rebuild because I
> need polymorphism to be enabled, and it seems to be missing an install-sh..
This is an XSD/e compiler binary for Linux x86_64 as well as the source
code for libxsde (which is what you need to build), exactly the same as
in the release distribution. If you would like to build the XSD/e compiler
from source, I can send the relevant archive.
Boris
From jeroen.vrijnsen at philips.com Thu Feb 16 12:19:34 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Thu Feb 16 12:19:50 2017
Subject: [xsde-users] Code generation fails for restricted list type
In-Reply-To:
References:
<2236e9204ba2452baed0073405ccc810@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Message-ID: <1974ef05948047fbb324d82aa0157eac@DB5PR9003MB0247.MGDPHG.emi.philips.com>
Hi Boris,
Indeed, works like a sunshine, it turns out I was mixing versions in my archive: using the rebuild 3.3.0.a8 libxsde.a, together with the 3.2.0 compiler... fixed now and it solves my issue as well :)
Thanks!
Jeroen
-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com]
Sent: 2017 Feb 16 5:37 PM
To: Vrijnsen, Jeroen
Cc: xsde-users@codesynthesis.com
Subject: Re: [xsde-users] Code generation fails for restricted list type
Hi Jeroen,
Vrijnsen, Jeroen writes:
> But the archive seems to be incomplete: I need to rebuild because I
> need polymorphism to be enabled, and it seems to be missing an install-sh..
This is an XSD/e compiler binary for Linux x86_64 as well as the source code for libxsde (which is what you need to build), exactly the same as in the release distribution. If you would like to build the XSD/e compiler from source, I can send the relevant archive.
Boris
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From boris at codesynthesis.com Fri Feb 17 09:17:57 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Fri Feb 17 09:18:06 2017
Subject: [xsde-users] Feature request: validate empty xs:base64binary
element
In-Reply-To:
References:
Message-ID:
Hi Jeroen,
> It is reported as being invalid, as base64-binary element is empty.
> However, the XSD standard allows this (although vague about it).
Can you point me to where the standard says this is allowed?
Thanks,
Boris
From jeroen.vrijnsen at philips.com Fri Feb 17 13:42:43 2017
From: jeroen.vrijnsen at philips.com (Vrijnsen, Jeroen)
Date: Fri Feb 17 13:42:59 2017
Subject: [xsde-users] Feature request: validate empty xs:base64binary
element
In-Reply-To:
References:
Message-ID:
Hi Boris,
I think it's here: https://www.w3.org/TR/xmlschema11-2/#base64Binary, section Value space: "The *value space* of base64Binary is the set of finite-length sequences of zero or more binary octets."
Furthermore, it defines the following regular expression:
((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?
which also suggest empty is allowed. But maybe I misunderstand, as I assume you know the standard pretty well.
-Jeroen
-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com]
Sent: 2017 Feb 17 3:18 PM
To: Vrijnsen, Jeroen
Cc: xsde-users@codesynthesis.com
Subject: Re: [xsde-users] Feature request: validate empty xs:base64binary element
Hi Jeroen,
> It is reported as being invalid, as base64-binary element is empty.
> However, the XSD standard allows this (although vague about it).
Can you point me to where the standard says this is allowed?
Thanks,
Boris
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
From laurent1984 at gmail.com Sat Feb 18 10:56:50 2017
From: laurent1984 at gmail.com (Laurent Michel)
Date: Mon Feb 20 06:13:24 2017
Subject: [xsde-users] Bug?
Message-ID:
Dear xsd/e support,
My objective is to be able to run my application on an android device. My
application makes use of XSD validation / XML data reading.
My first shot was to use the XSD library, but, for some reason I don't
really understand, it doesn't work. I cross-compiled icu and xerces-c for
the target architecture (I tried android-x86 and android-aarch64) and as
soon as I'm trying to construct an object of the type I am defining in my
xsd schemes, the application crashes. In a debug session, I was able to see
that the problem was the following: I have an XSD class
class Action: public ::xml_schema::type
{
public:
[...]
typedef ::xml_schema::string title_type;
[...]
Action (const title_type&);
[...]
}
And the application crashes under Android whenever I call something like
Action("");
or
Action("myString");
It also crashes if I call
auto tmp = ::xml_schema::string("hahaha");
It works, however, perfectly fine under my Ubuntu distro, it worked also
fine under Windows 10. What I don't really understand is, that I only link
against icu and xerces-c and I only include the xsd header files during
compilation, be it for windows 10, Ubuntu, or android. So, there can't be
any problem with xsd... but apparently I have one, which is what I
don't understand. Maybe you guys know incidentally what can go wrong in my
case when I then want to use XSD on android.
Here's how I compile icu:
https://github.com/zadigus/BrainReliefer/blob/master/config/cross-compilation/icu/compileAll.sh
Here's how I compile xerces-c:
https://github.com/zadigus/BrainReliefer/blob/master/config/cross-compilation/xerces-c/compileAll.sh
I tried to use XSD's last version (4.0.0). In order to make this work, I
guess I need to cross-compile XSD too ... but there is nowhere an advice
that I should do it like this.
Because XSD didn't work for me, I tried to switch to XSD/e, which would be
a good idea anyway because it is a lightweight library and this is what
people are usually looking for when they are programming mobile apps.
Here's how I cross-compile XSD/e:
https://github.com/zadigus/BrainReliefer/blob/master/config/cross-compilation/xsde/compile.sh
Alright. This script lets me cross-compile XSD/e up to one point (and it is
not using any of the etc/android stuff as recommended, sorry, I am not used
to compile my code with these *.mk files which I absolutely don't
understand...): if I do this:
make CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" CC="$CC"
CXX="$CXX" AR="$AR" RANLIB="$RANLIB"
where all the variables are well-defined, then I notice that (at least) the
AR and RANLIB variables are not set by the values I chose for them, i.e.
every time I compiled my code, whatever RANLIB or AR are, make used the
default /usr/bin/ar and /usr/bin/ranlib executables. This is not the case
for the other variables. My fix for this issue was simply to update the
file
~/Downloads/xsde/xsde/build/ld/configuration-lib-dynamic.make
from this
ld_lib_type := archive
ld_lib_ar := ar
ld_lib_ranlib := ranlib
to this
ld_lib_type := archive
ld_lib_ar := $(AR)
ld_lib_ranlib := $(RANLIB)
And now, make is using what I told it to use ...
However, this fix may not be philosophically compatible with what you are
doing, I don't know. Maybe the way I am cross-compiling XSD/e is wrong, no
idea. All I know is that I have now a static library which seems to be
compatible with my android architecture. I haven't tested linking my
application against this cross-compiled xsd/e yet. The way I compiled XSD/e
is the very same way I compiled Qt, boost, icu, and xerces-c.
Maybe it's fine to use the /usr/bin/ranlib and /usr/bin/ar. I saw that
these binaries are somehow compatible with android...
Thank your in advance for your advice,
Laurent
From boris at codesynthesis.com Mon Feb 20 12:19:57 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Mon Feb 20 12:20:06 2017
Subject: [xsde-users] Feature request: validate empty xs:base64binary
element
In-Reply-To:
References:
Message-ID:
Hi Jeroen,
Vrijnsen, Jeroen writes:
> I think it's here: https://www.w3.org/TR/xmlschema11-2/#base64Binary [...]
Yes, looks like you are right, empty lexical space is allowed. I've made
the fix:
http://scm.codesynthesis.com/?p=xsde/xsde.git;a=commit;h=9539f5fe95589c9fc6c53290b4ed5a1af42e0d8c
Thanks,
Boris
From boris at codesynthesis.com Mon Feb 20 12:30:39 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Mon Feb 20 12:30:48 2017
Subject: [xsde-users] Bug?
In-Reply-To:
References:
Message-ID:
Hi Laurent,
Laurent Michel writes:
> It works, however, perfectly fine under my Ubuntu distro, it worked also
> fine under Windows 10. What I don't really understand is, that I only link
> against icu and xerces-c and I only include the xsd header files during
> compilation, be it for windows 10, Ubuntu, or android.
ICU and/or Xerces-C are probably not compatible with the Android runtime
or you didn't compile them properly. We don't really support this
configuration so I am not sure what's going on.
> Here's how I cross-compile XSD/e [...]
Can you try to download a pre-built binary (e.g., for Linux) and then
cross-compile just libxsde/ as instructed in the accompanying INSTALL
file?
Boris
From laurent1984 at gmail.com Tue Feb 21 02:36:43 2017
From: laurent1984 at gmail.com (Laurent Michel)
Date: Tue Feb 21 11:34:24 2017
Subject: [xsde-users] Bug?
In-Reply-To:
References:
Message-ID:
Hi Boris,
Regarding ICU and Xerces-c, I think you are wrong, because in order to
compile XSD/e, I needed to link against xerces-c. In order compile
xerces-c, I needed to link against icu (because for some reason linking
against iconv didn't work). And ... my application is working under android
since yesterday night, in the very way I told you I compiled everything,
which is also, in my opinion, the natural way to do it (when you know
nothing about cross-compiling).
When I have some time, I will try to follow the instructions of the INSTALL
file. But I checked the config.make and the Android.mk and I can't remember
having seen any command that would overwrite the ranlib and ar binaries.
Other question: I have noticed that sometimes the c++ code generated by
XSD/e contains classes with private copy constructors. In what cases do you
generate such classes? In my case, I don't think it's making any sense. The
class is only containing strings and sequences of strings and still, copy
is disabled. Why?
Cheers,
Laurent
On Mon, Feb 20, 2017 at 6:30 PM, Boris Kolpackov
wrote:
> Hi Laurent,
>
> Laurent Michel writes:
>
> > It works, however, perfectly fine under my Ubuntu distro, it worked also
> > fine under Windows 10. What I don't really understand is, that I only
> link
> > against icu and xerces-c and I only include the xsd header files during
> > compilation, be it for windows 10, Ubuntu, or android.
>
> ICU and/or Xerces-C are probably not compatible with the Android runtime
> or you didn't compile them properly. We don't really support this
> configuration so I am not sure what's going on.
>
>
> > Here's how I cross-compile XSD/e [...]
>
> Can you try to download a pre-built binary (e.g., for Linux) and then
> cross-compile just libxsde/ as instructed in the accompanying INSTALL
> file?
>
> Boris
>
From boris at codesynthesis.com Tue Feb 21 11:56:49 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Tue Feb 21 11:56:58 2017
Subject: [xsde-users] Bug?
In-Reply-To:
References:
Message-ID:
Hi Laurent,
Laurent Michel writes:
> Regarding ICU and Xerces-c, I think you are wrong, because in order to
> compile XSD/e, I needed to link against xerces-c. In order compile
> xerces-c, I needed to link against icu (because for some reason linking
> against iconv didn't work).
I may very well be wrong, though, normally, we don't compile the XSD/e
compiler (the only part in XSD/e that depends on Xerces-C++) for a mobile
target. Instead we compile it for a "host development platform", such as
Linux or Windows. We then use that compiler binary to generate C++ source
code which you then cross-compile to your mobile target.
It may be possible to run the XSD/e compiler natively on your phone.
However, we don't test it and don't support it -- life is too short ;-).
> Other question: I have noticed that sometimes the c++ code generated by
> XSD/e contains classes with private copy constructors. In what cases do you
> generate such classes? In my case, I don't think it's making any sense. The
> class is only containing strings and sequences of strings and still, copy
> is disabled. Why?
Because they are variable-length (i.e., own dynamically-allocated memory).
XSD/e, being very minimal, does not support automatic copying of such
objects.
Boris
From laurent1984 at gmail.com Tue Feb 21 12:30:52 2017
From: laurent1984 at gmail.com (Laurent Michel)
Date: Tue Feb 21 12:46:33 2017
Subject: [xsde-users] Bug?
In-Reply-To:
References:
Message-ID:
Oh there was then a misunderstanding. I didn't compile the XSD/e compiler,
but only the library.
What I find surprising is that there was no advice to do so for the XSD
library... In the pre-compiled linux distribution of XSD, there is not even
an .so or an .a library; in the XSD documentation, there is no mention that
such a library is necessary to compile my code. For instance, if I compile
a linux version of my application, I need no XSD library as such. For
Android though, I have the feeling I'd need one, which I may get from the
published source code of XSD. But now I've switched to XSD/e, I will
probably not go back to testing with XSD, because, as you say, life is too
short!
Laurent
On Tue, Feb 21, 2017 at 5:56 PM, Boris Kolpackov
wrote:
> Hi Laurent,
>
> Laurent Michel writes:
>
> > Regarding ICU and Xerces-c, I think you are wrong, because in order to
> > compile XSD/e, I needed to link against xerces-c. In order compile
> > xerces-c, I needed to link against icu (because for some reason linking
> > against iconv didn't work).
>
> I may very well be wrong, though, normally, we don't compile the XSD/e
> compiler (the only part in XSD/e that depends on Xerces-C++) for a mobile
> target. Instead we compile it for a "host development platform", such as
> Linux or Windows. We then use that compiler binary to generate C++ source
> code which you then cross-compile to your mobile target.
>
> It may be possible to run the XSD/e compiler natively on your phone.
> However, we don't test it and don't support it -- life is too short ;-).
>
>
> > Other question: I have noticed that sometimes the c++ code generated by
> > XSD/e contains classes with private copy constructors. In what cases do
> you
> > generate such classes? In my case, I don't think it's making any sense.
> The
> > class is only containing strings and sequences of strings and still, copy
> > is disabled. Why?
>
> Because they are variable-length (i.e., own dynamically-allocated memory).
> XSD/e, being very minimal, does not support automatic copying of such
> objects.
>
> Boris
>
From laurent1984 at gmail.com Tue Feb 21 16:15:55 2017
From: laurent1984 at gmail.com (Laurent Michel)
Date: Wed Feb 22 11:05:48 2017
Subject: [xsde-users] Re: Bug?
In-Reply-To:
References:
Message-ID:
Btw, if you disable copy constructors, how do you serialize data then?
Because it can be that I have an xsd element made of a sequence of e.g.
strings that I would like to serialize. Since this has variable length, I
have no copy ctor for my element. Is xsd/e compatible with move
constructors?
On Tuesday, February 21, 2017, Boris Kolpackov
wrote:
> Hi Laurent,
>
> Laurent Michel writes:
>
>> Regarding ICU and Xerces-c, I think you are wrong, because in order to
>> compile XSD/e, I needed to link against xerces-c. In order compile
>> xerces-c, I needed to link against icu (because for some reason linking
>> against iconv didn't work).
>
> I may very well be wrong, though, normally, we don't compile the XSD/e
> compiler (the only part in XSD/e that depends on Xerces-C++) for a mobile
> target. Instead we compile it for a "host development platform", such as
> Linux or Windows. We then use that compiler binary to generate C++ source
> code which you then cross-compile to your mobile target.
>
> It may be possible to run the XSD/e compiler natively on your phone.
> However, we don't test it and don't support it -- life is too short ;-).
>
>
>> Other question: I have noticed that sometimes the c++ code generated by
>> XSD/e contains classes with private copy constructors. In what cases do
you
>> generate such classes? In my case, I don't think it's making any sense.
The
>> class is only containing strings and sequences of strings and still, copy
>> is disabled. Why?
>
> Because they are variable-length (i.e., own dynamically-allocated memory).
> XSD/e, being very minimal, does not support automatic copying of such
> objects.
>
> Boris
>
From boris at codesynthesis.com Wed Feb 22 11:28:48 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Wed Feb 22 11:28:57 2017
Subject: [xsde-users] Re: Bug?
In-Reply-To:
References:
Message-ID:
Hi Laurent,
Laurent Michel writes:
> Btw, if you disable copy constructors, how do you serialize data then?
> Because it can be that I have an xsd element made of a sequence of e.g.
> strings that I would like to serialize. Since this has variable length, I
> have no copy ctor for my element.
I don't understand why you need a copy to serialize things? It's not like
serialization is somehow destructive? You just pass (const) references.
> Is xsd/e compatible with move constructors?
No, XSD/e doesn't generate move constructors yet.
Boris
From laurent1984 at gmail.com Wed Feb 22 12:00:12 2017
From: laurent1984 at gmail.com (Laurent Michel)
Date: Wed Feb 22 12:07:02 2017
Subject: [xsde-users] Re: Bug?
In-Reply-To:
References:
Message-ID:
Hi Boris,
Basically, I have this class
class IntrantList
{
private:
IntrantList (const IntrantList&);
IntrantList& operator= (const IntrantList&);
public:
IntrantList ();
~IntrantList ();
// Intrant
//
typedef ::xsde::cxx::hybrid::var_sequence< ::N_Data::Intrant >
Intrant_sequence;
typedef Intrant_sequence::iterator Intrant_iterator;
typedef Intrant_sequence::const_iterator Intrant_const_iterator;
const Intrant_sequence&
Intrant () const;
Intrant_sequence&
Intrant ();
private:
Intrant_sequence Intrant_;
};
which contains a sequence of intrants defined like this (it has, in
reality, more data than that):
class Intrant
{
private:
Intrant (const Intrant&);
Intrant& operator= (const Intrant&);
public:
Intrant ();
~Intrant ();
// title
//
const ::std::string&
title () const;
::std::string&
title ();
void
title (const ::std::string&);
// actions
//
bool
actions_present () const;
const ::N_Data::ActionList&
actions () const;
::N_Data::ActionList&
actions ();
void
actions (::N_Data::ActionList*);
private:
::std::string title_;
::N_Data::ActionList* actions_;
};
Then, what I want to do is something like this:
void MyClass::addIntrant(const Intrant& a_Intrant)
{
m_Data->Intrant().push_back(a_Intrant);
}
where
std::unique_ptr m_Data;
This is what my application used to do when I linked it with XSD. Now I am
working with XSD/e, I can't do that any more, because I have no copy
constructor for the Intrant class. The idea is that I then do something
like what is described in the documentation
http://www.codesynthesis.com/projects/xsde/documentation/cxx/hybrid/guide/#2.5
to output my XML file with all the data I want in it.
The big "problem" I have is that I first wrote my application with XSD. One
of the features of the application is that it can fill an XML file with
Intrants based on user input. I start with an empty list and just fill it
with whatever it is the user wants. The data filled by the user are stored
in an object of type Intrant, which has now no copy constructor. I want
this object to be appended to my list of Intrants. XSD/e users surely do
that kind of things, don't they?
What is the best practice with XSD/e?
BUT, maybe I am fine with just pointers or references, because I saw that
you define your sequences like this:
template
class var_sequence: public sequence_base
{
[...]
#ifndef XSDE_EXCEPTIONS
error
#else
void
#endif
push_back (T*);
}
which means you don't store the sequence elements by value but by
reference. So, as far as I understand, as long as my objects exist
somewhere in the heap, I can add them to the sequence without using any
copy constructor. Am I right? That seems to be the whole big difference
with XSD. This would also mean that I don't have much to do to make this
work again.
Cheers,
Laurent
On Wed, Feb 22, 2017 at 5:28 PM, Boris Kolpackov
wrote:
> Hi Laurent,
>
> Laurent Michel writes:
>
> > Btw, if you disable copy constructors, how do you serialize data then?
> > Because it can be that I have an xsd element made of a sequence of e.g.
> > strings that I would like to serialize. Since this has variable length, I
> > have no copy ctor for my element.
>
> I don't understand why you need a copy to serialize things? It's not like
> serialization is somehow destructive? You just pass (const) references.
>
>
> > Is xsd/e compatible with move constructors?
>
> No, XSD/e doesn't generate move constructors yet.
>
> Boris
>
From boris at codesynthesis.com Thu Feb 23 11:24:54 2017
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Thu Feb 23 11:25:04 2017
Subject: [xsde-users] Re: Bug?
In-Reply-To:
References:
Message-ID:
Hi Laurent,
Laurent Michel writes:
> BUT, maybe I am fine with just pointers or references, because I saw that
> you define your sequences like this:
>
> template
> class var_sequence: public sequence_base
> {
>
> [...]
>
> #ifndef XSDE_EXCEPTIONS
> error
> #else
> void
> #endif
> push_back (T*);
> }
>
> which means you don't store the sequence elements by value but by
> reference.
Actually, push_back() will assume ownership of the passed node.
> So, as far as I understand, as long as my objects exist somewhere in
> the heap, I can add them to the sequence without using any copy
> constructor.
Right, except that you don't need to delete them (unless you also
detach the node).
Boris