From zwang at liquidcapital.com Mon Apr 1 06:06:53 2013
From: zwang at liquidcapital.com (Zhijie Wang)
Date: Mon Apr 1 06:07:01 2013
Subject: [xsd-users] XSD Serialization for decimal field type
Message-ID: <299164AA9B8BD6459159EDE47D51D9452AD92BD9@lcas-mail12.Aus.Liquid-Capital.liquidcap.com>
Hello,
I'm trying codesyntehsis xsd utility for the first time. I fill the one field of the C++ class code Gened by XSD with decimal type: 1594.8 then I serialize the class to xml string, the decimal field became to 1594.800000000000182.
Seems XSD convert it to the precision of 15 decimal digit. As I want to set it to one decimal digit value, is there a way I can truncate it to 1594.8 for this case?
The field schema definition as below:
float field representing a price. Note the number of decimal places may vary. For certain asset classes prices may be negative values.
Thanks
Best regards,
Zhijie
Liquid Capital Software Consulting (Chengdu) Co., Ltd
Office Line: +86 28 6633 8890 ext.205
Liquid Capital Australia Pty Limited is registered with the Australian Securities and Investment Commission and located in Australia.
Liquid Capital Markets Hong Kong Limited is registered with the Securities and Futures Commission in Hong Kong and
located in Hong Kong.
Liquid Capital Investments Hong Kong Limited and Liquid Capital Securities Hong Kong Limited are registered and located in Hong Kong.
For more information about these companies, please contact + 61 2 8231 1159.
Please click this link for terms relating to all email correspondence.
From boris at codesynthesis.com Mon Apr 1 07:44:41 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Mon Apr 1 07:44:47 2013
Subject: [xsd-users] XSD Serialization for decimal field type
In-Reply-To: <299164AA9B8BD6459159EDE47D51D9452AD92BD9@lcas-mail12.Aus.Liquid-Capital.liquidcap.com>
References: <299164AA9B8BD6459159EDE47D51D9452AD92BD9@lcas-mail12.Aus.Liquid-Capital.liquidcap.com>
Message-ID:
Hi Zhijie,
Zhijie Wang writes:
> Seems XSD convert it to the precision of 15 decimal digit. As I want to
> set it to one decimal digit value, is there a way I can truncate it to
> 1594.8 for this case?
>
> [...]
>
>
There are several ways to achieve this. The easiest and cleanest is
to specify the fractionDigits facet in the schema. Other options are
to use a macro or to customize the type. See the README file in the
examples/cxx/tree/custom/double example for details.
Boris
From zwang at liquidcapital.com Mon Apr 1 21:48:46 2013
From: zwang at liquidcapital.com (Zhijie Wang)
Date: Mon Apr 1 21:48:56 2013
Subject: [xsd-users] XSD Serialization for decimal field type
In-Reply-To:
References: <299164AA9B8BD6459159EDE47D51D9452AD92BD9@lcas-mail12.Aus.Liquid-Capital.liquidcap.com>
Message-ID: <299164AA9B8BD6459159EDE47D51D9452AD92D16@lcas-mail12.Aus.Liquid-Capital.liquidcap.com>
Hi Boris,
Thanks a lot for your information.
Best regards,
Zhijie
-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com]
Sent: 01 April 2013 19:45
To: Zhijie Wang
Cc: xsd-users@codesynthesis.com
Subject: Re: [xsd-users] XSD Serialization for decimal field type
Hi Zhijie,
Zhijie Wang writes:
> Seems XSD convert it to the precision of 15 decimal digit. As I want
> to set it to one decimal digit value, is there a way I can truncate it
> to
> 1594.8 for this case?
>
> [...]
>
>
There are several ways to achieve this. The easiest and cleanest is to specify the fractionDigits facet in the schema. Other options are to use a macro or to customize the type. See the README file in the examples/cxx/tree/custom/double example for details.
Boris
Liquid Capital Australia Pty Limited is registered with the Australian Securities and Investment Commission and located in Australia.
Liquid Capital Markets Hong Kong Limited is registered with the Securities and Futures Commission in Hong Kong and
located in Hong Kong.
Liquid Capital Investments Hong Kong Limited and Liquid Capital Securities Hong Kong Limited are registered and located in Hong Kong.
For more information about these companies, please contact + 61 2 8231 1159.
Please click this link for terms relating to all email correspondence.
From Arul.Prakash2 at rsa.com Tue Apr 2 08:43:28 2013
From: Arul.Prakash2 at rsa.com (Prakash, Arul)
Date: Tue Apr 2 09:46:02 2013
Subject: [xsd-users] XML signature validation
Message-ID: <0DB3CF5C512BBD4FA7E3A8ECD8FE735214ADA7874A@MX26A.corp.emc.com>
Hi Boris,
I am trying to verify the signature in a xml document, was wondering if there is any option to do that using CodeSynthesis?
Thanks
Arul
From boris at codesynthesis.com Tue Apr 2 10:19:35 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Tue Apr 2 10:19:43 2013
Subject: [xsd-users] XML signature validation
In-Reply-To: <0DB3CF5C512BBD4FA7E3A8ECD8FE735214ADA7874A@MX26A.corp.emc.com>
References: <0DB3CF5C512BBD4FA7E3A8ECD8FE735214ADA7874A@MX26A.corp.emc.com>
Message-ID:
Hi Arul,
Prakash, Arul writes:
> I am trying to verify the signature in a xml document, was wondering
> if there is any option to do that using CodeSynthesis?
No, XSD does not provide built-in support for this. Rather, you would
need to do it at the Xerces-C++ DOM level. That is, first read the XML
to DOM, verify the signature, then parse DOM to object model. Similarly,
for serialization, first serialize the object model to DOM, add the
signature, then serialize DOM to XML.
You can use the Apache XML Security Library for C++ to do all the
signing/verifying:
http://santuario.apache.org
This page has some sample code:
http://stackoverflow.com/questions/15334616/enveloping-and-detached-xml-signatures-using-apache-xml-security-c-xsec
Boris
From mfreedman at ll.mit.edu Fri Apr 5 14:49:13 2013
From: mfreedman at ll.mit.edu (Michael R. Freedman)
Date: Fri Apr 5 14:55:33 2013
Subject: [xsd-users] Make suitable dependency generation
In-Reply-To: 50EABEAA.2010908@tower-research.com
Message-ID: <1365187753.1838.2.camel@gt500.llan.ll.mit.edu>
I just downloaded this version and am very happy that this feature has
been added. The only problem that I have is that it does not pre-pend
the output directory specified by --output-dir to the dependency
targets. Hoping this is coming soon!
Thanks!!!!
From mfreedman at ll.mit.edu Fri Apr 5 17:21:55 2013
From: mfreedman at ll.mit.edu (Michael R. Freedman)
Date: Sat Apr 6 11:11:37 2013
Subject: [xsd-users] Make suitable dependency generation
Message-ID: <1365196915.58084.2.camel@gt500.llan.ll.mit.edu>
I was able to modify the code so that it does what I want it do to and
should still work for all other cases. In cxx/tree/generator.cxx,
starting around line 638 where the target variable is build up, I
changed all the .leaf() calls to .native_file_string() calls. I'm still
struggling with building a distro that I can then move to the new
operating system that I'm using. The new OS has a version of boost that
breaks a lot of the code.
// DEP
//
if (gen_dep)
{
NarrowString target;
NarrowStrings const& ts (ops.dep_target ());
if (!ts.empty ())
{
for (NarrowStrings::const_iterator i (ts.begin ());
i != ts.end (); ++i)
target += (target.empty () ? "" : " \\\n") + *i;
}
else
{
target = hxx_path.native_file_string ();
if (forward)
target += " \\\n" + fwd_path.native_file_string();
if (inline_)
target += " \\\n" + ixx_path.native_file_string ();
for (Paths::iterator i (cxx_paths.begin ());
i != cxx_paths.end (); ++i) {
target += " \\\n" + i->native_file_string ();
}
target += " \\\n" + dep_path.native_file_string ();
std::cout << "target : " << target << std::endl;
}
dep << target.c_str () << ':';
From amnw14545 at googlemail.com Mon Apr 8 05:42:18 2013
From: amnw14545 at googlemail.com (Tony McConnell)
Date: Mon Apr 8 10:09:28 2013
Subject: [xsd-users] Multiple schemas with the same namespace,
compiled into a library
Message-ID:
Hi
Firstly, I have no control at all over the schemas I'm given...
I've attached some example code and schemas to show what the behaviour is.
I'm using xsd 3.3.0, on Ubuntu 10.04.4, linked with xerces-c 3.1.0.
Compiled with gcc 4.4.3.
The attached tar archive builds a library that contains two schemas that
both have the same namespace.
t2.xsd contains extra definitions that are not in t1.xsd, but is capable of
validating everything that t1.xsd can.
In principle, I could receive a lot of extended schemas t3.xsd, t4.xsd,
etc, that are all extensions of t1.xsd but not of each other.
Basically, I parse the schemas in the order, t1.xsd, t2.xsd, etc, to find
out which one I'm using.
However, I get a strange message: type '' is not derived from ''
If my object files are linked into the library in order t1.o, t2.o, I get
the error when parsing t2.xml
If my object files are linked into the library in order t2.o t1.o, I get
the error when parsing t1.xml
Please could someone tell me what type '' is not derived from '' means?
Thank you.
Tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp.tgz
Type: application/x-gzip
Size: 54622 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20130408/6859a84a/tmp-0001.bin
From boris at codesynthesis.com Mon Apr 8 10:29:22 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Mon Apr 8 10:29:29 2013
Subject: [xsd-users] Multiple schemas with the same namespace, compiled
into a library
In-Reply-To:
References:
Message-ID:
Hi Tony,
Tony McConnell writes:
> However, I get a strange message: type '' is not derived from ''
I took a look at your test and I see your schemas use polymorphism.
The problem is that there is only one map that maps type names (as
appear in xsi:type in your XML documents) to C++ types that will be
instantiated.
> If my object files are linked into the library in order t1.o, t2.o, I get
> the error when parsing t2.xml
>
> If my object files are linked into the library in order t2.o t1.o, I get
> the error when parsing t1.xml
The link order determines which schema "wins" registering its type
information in the above mentioned map.
> Please could someone tell me what type '' is not derived from '' means?
This error means that a supposedly derived type is actually not derived
from the expected base. I am pretty sure it is caused by the "registration
race".
The XSD runtime actually has a mechanism for creating multiple set of
maps (called "plates"). It's just that the XSD compiler doesn't expose
this and always uses plate 0. If you would like, I can add an option to
the XSD compile to allow one to specify the plate number to use. With
this support you can then place each schema on its own plate, just like
you are already mapping them to their own C++ namespaces.
Boris
From boris at codesynthesis.com Mon Apr 8 10:52:08 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Mon Apr 8 10:52:17 2013
Subject: [xsd-users] Make suitable dependency generation
In-Reply-To: <1365187753.1838.2.camel@gt500.llan.ll.mit.edu>
References: <1365187753.1838.2.camel@gt500.llan.ll.mit.edu>
Message-ID:
Hi Michael,
Michael R. Freedman writes:
> The only problem that I have is that it does not pre-pend the output
> directory specified by --output-dir to the dependency targets.
That was actually intentional. Normally, make rules specify targets
without the directory parts and if they are residing in directories
other than the current directory, then they are located with the
help of VPATH. See, for example, Paul's Third Rule of Makefiles[1]
and How Not to Use VPATH[2].
But now, thinking about it some more, I believe we should include the
directory part since the makefile that is compiling the schema and that
specifies the output directory is most likely also the same makefile
that includes the generated dependency file. And if that dependency
file doesn't have the output directory part, then the dependency
information will be useless.
So I am going to make the change.
Also note that you can easily change this behavior even now with the
--dep-target option, for example:
xsd --output-dir foo --dep-target "foo/bar.hxx foo/bar.cxx foo/bar.d" bar.xsd
A bit verbose but doable.
[1] http://mad-scientist.net/make/rules.html#rule3
[2] http://mad-scientist.net/make/vpath.html
Boris
From amnw14545 at googlemail.com Mon Apr 8 10:36:32 2013
From: amnw14545 at googlemail.com (Tony McConnell)
Date: Mon Apr 8 10:56:46 2013
Subject: [xsd-users] Multiple schemas with the same namespace, compiled
into a library
In-Reply-To:
References:
Message-ID:
Boris, if you could do that, that would be great!
Thanks
Tony
On Mon, Apr 8, 2013 at 3:29 PM, Boris Kolpackov wrote:
> Hi Tony,
>
> Tony McConnell writes:
>
> > However, I get a strange message: type '' is not derived from ''
>
> I took a look at your test and I see your schemas use polymorphism.
> The problem is that there is only one map that maps type names (as
> appear in xsi:type in your XML documents) to C++ types that will be
> instantiated.
>
>
> > If my object files are linked into the library in order t1.o, t2.o, I get
> > the error when parsing t2.xml
> >
> > If my object files are linked into the library in order t2.o t1.o, I get
> > the error when parsing t1.xml
>
> The link order determines which schema "wins" registering its type
> information in the above mentioned map.
>
>
> > Please could someone tell me what type '' is not derived from '' means?
>
> This error means that a supposedly derived type is actually not derived
> from the expected base. I am pretty sure it is caused by the "registration
> race".
>
> The XSD runtime actually has a mechanism for creating multiple set of
> maps (called "plates"). It's just that the XSD compiler doesn't expose
> this and always uses plate 0. If you would like, I can add an option to
> the XSD compile to allow one to specify the plate number to use. With
> this support you can then place each schema on its own plate, just like
> you are already mapping them to their own C++ namespaces.
>
> Boris
>
From nicolas.derhy at gdfsuez.com Thu Apr 11 09:57:35 2013
From: nicolas.derhy at gdfsuez.com (nicolas.derhy@gdfsuez.com)
Date: Thu Apr 11 09:58:36 2013
Subject: [xsd-users] sequence to std::vector
Message-ID: <5F0C4E4675DD604EA843CB001E2D65D90962D978CD@xs203434.MELINDA.LOCAL>
Hi everybody,
I recently discover CodeSynthesis XSD when looking for a c++ tool like xsd2code.
I have tested the basic features of this product and I am quite well surprised.
However, I have one problem with the generated code : the list are "sequence" and not "std::vector".
I have already a lot of source code whose methods use parameters of type std::vector so I do not want modify existing code by replacing vector by sequence.
So, is there a way to cast sequence to vector ?
Best regards,
Nicolas
GDF SUEZ Mail Disclaimer: http://www.gdfsuez.com/disclaimer/disclaimer-fr.html
From boris at codesynthesis.com Thu Apr 11 10:08:25 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Thu Apr 11 10:08:32 2013
Subject: [xsd-users] sequence to std::vector
In-Reply-To: <5F0C4E4675DD604EA843CB001E2D65D90962D978CD@xs203434.MELINDA.LOCAL>
References: <5F0C4E4675DD604EA843CB001E2D65D90962D978CD@xs203434.MELINDA.LOCAL>
Message-ID:
Hi Nicolas,
nicolas.derhy@gdfsuez.com writes:
> I have tested the basic features of this product and I am quite well
> surprised.
I hope in a positive way ;-).
> However, I have one problem with the generated code : the list are
> "sequence" and not "std::vector". I have already a lot of source
> code whose methods use parameters of type std::vector so I do not
> want modify existing code by replacing vector by sequence. So, is
> there a way to cast sequence to vector ?
For fundamental C++ types (integers, floating point, etc), XSD sequence
is a class derived from std::vector so you should be able to pass it as
std::vector without any problems.
For non-fundamental types the only way to do this is to create a copy
as std::vector:
root_type::foo_sequence& s (r.foo ());
std::vector (s.begin (), s.end ());
Boris
From boris at codesynthesis.com Thu Apr 11 11:06:51 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Thu Apr 11 11:06:59 2013
Subject: [xsd-users] Multiple schemas with the same namespace, compiled
into a library
In-Reply-To:
References:
Message-ID:
Hi Tony,
Ok, I've implemented this feature and built an x86_64 GNU/Linux binary
for you to try (I assumed that's what you are using, if not, let me know):
http://codesynthesis.com/~boris/tmp/xsd/xsd-4.0.0.a12-x86_64-linux-gnu.tar.bz2
The new option is --polymorphic-plate . The idea is that you need
assign a different plate (1, 2, 3, etc) to each of your schemas so that
they each get their own set of polymorphic maps.
Let me know how it goes.
Boris
From amnw14545 at googlemail.com Thu Apr 11 12:53:51 2013
From: amnw14545 at googlemail.com (Tony McConnell)
Date: Fri Apr 12 11:23:35 2013
Subject: [xsd-users] Multiple schemas with the same namespace,
compiled into a library
In-Reply-To:
References:
Message-ID:
Hi Boris,
Thanks very much for this, I've got access to a 64 bit machine so that should be OK.
I'll let you know as soon as I've tried it.
On 11 Apr 2013, at 16:06, Boris Kolpackov wrote:
> Hi Tony,
>
> Ok, I've implemented this feature and built an x86_64 GNU/Linux binary
> for you to try (I assumed that's what you are using, if not, let me know):
>
> http://codesynthesis.com/~boris/tmp/xsd/xsd-4.0.0.a12-x86_64-linux-gnu.tar.bz2
>
> The new option is --polymorphic-plate . The idea is that you need
> assign a different plate (1, 2, 3, etc) to each of your schemas so that
> they each get their own set of polymorphic maps.
>
> Let me know how it goes.
>
> Boris
From amnw14545 at googlemail.com Fri Apr 12 04:38:07 2013
From: amnw14545 at googlemail.com (Tony McConnell)
Date: Fri Apr 12 11:23:35 2013
Subject: [xsd-users] Multiple schemas with the same namespace, compiled
into a library
In-Reply-To:
References:
Message-ID:
Hi Boris,
That works well, thank you for your help!
Tony
On Thu, Apr 11, 2013 at 5:53 PM, Tony McConnell wrote:
> Hi Boris,
>
> Thanks very much for this, I've got access to a 64 bit machine so that
> should be OK.
>
> I'll let you know as soon as I've tried it.
>
> On 11 Apr 2013, at 16:06, Boris Kolpackov wrote:
>
> > Hi Tony,
> >
> > Ok, I've implemented this feature and built an x86_64 GNU/Linux binary
> > for you to try (I assumed that's what you are using, if not, let me
> know):
> >
> >
> http://codesynthesis.com/~boris/tmp/xsd/xsd-4.0.0.a12-x86_64-linux-gnu.tar.bz2
> >
> > The new option is --polymorphic-plate . The idea is that you need
> > assign a different plate (1, 2, 3, etc) to each of your schemas so that
> > they each get their own set of polymorphic maps.
> >
> > Let me know how it goes.
> >
> > Boris
>
From mjklaim at gmail.com Mon Apr 15 06:19:31 2013
From: mjklaim at gmail.com (=?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?=)
Date: Mon Apr 15 06:19:37 2013
Subject: [xsd-users] Windows Mingw binaries?
Message-ID:
Hi,
I can't find Mingw binaries in my installed version of xsd on Windows
(using the msi file).
1. is there the mingw library binaries somewhere?
2. would it be compatible with an application compiled with more recent
mingw?
Joel Lamotte
From boris at codesynthesis.com Mon Apr 15 07:05:43 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Mon Apr 15 07:05:50 2013
Subject: [xsd-users] Windows Mingw binaries?
In-Reply-To:
References:
Message-ID:
Hi Jo?l,
Klaim - Jo?l Lamotte writes:
> I can't find Mingw binaries in my installed version of xsd on Windows
> (using the msi file).
>
> 1. is there the mingw library binaries somewhere?
You mean pre-built Xerces-C++ libraries for MinGW? If that's the case,
then, no, we don't provide them.
> 2. would it be compatible with an application compiled with more recent
> mingw?
That's hard to say, which is why we don't provide them. It is best to
build them yourself (instructions on the Xerces-C++ web site).
Boris
From adrian.stern at screenfood.com Tue Apr 16 08:07:49 2013
From: adrian.stern at screenfood.com (Adrian Stern)
Date: Tue Apr 16 08:07:59 2013
Subject: [xsd-users] How to laod a XSD generated class
Message-ID:
Hi
I'm playing around with xsd and i pretty much like what i've seen so far. There is one Problem tought. I can't figure out how to load a class generated by xsd.
The root element is called special-smil. From this a class named special_smil was generated. Adding the whole stuff to qtcreator and compiling it all is not an issue. But it seems as if the Interfaces published on the website may have changes.
Source: http://www.codesynthesis.com/products/xsd/
The samble behind the source above suggests a can create an instance (and deserialize the xml file) with simply doing:
auto_ptr c = contact ("c.xml");
or in my case:
auto_ptr c = special_smil ("c.xml");
The error I get is the following:
../networkXml/main.cpp:11:60: error: no matching function for call to 'special_smil::special_smil(const char [14])'
auto_ptr s = special_smil("/tmp/test.xml");
I looked into the header and there is no constructor expecting a string. They all expect much more parameters.
The Documentation does not help very much since they seem to be focusing on samples who just "work". I don't know what the difference about my XSD is.
How do I find the entry point into the structure? Maybe there is a documentation I couldn't find. So please point me an a direction.
Here is how I generated the classes:
sudo xsdcxx cxx-tree --cxx-suffix .cpp --hxx-suffix .h --root-element special-smil --generate-serialization --show-sloc screenfood-0.1.xsd
Freundliche Gr?sse / Best Regards / Meilleures salutations
Adrian Stern
Diese E-Mail und ihre Anh?nge enthalten vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anh?nge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet.
This e-mail and any attachments may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
From boris at codesynthesis.com Tue Apr 16 08:25:19 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Tue Apr 16 08:25:31 2013
Subject: [xsd-users] How to laod a XSD generated class
In-Reply-To:
References:
Message-ID:
Hi Adrian,
Adrian Stern writes:
> The root element is called special-smil. From this a class named
> special_smil was generated.
>
> [...]
>
> auto_ptr c = special_smil ("c.xml");
If the root type and root element have the same name, then XSD
appends an underscore to the parsing/serialization functions (it
is a pain in C++ to have both a type and a function with the same
name).
So try something like this:
auto_ptr c = special_smil_ ("c.xml");
Boris
From adrian.stern at screenfood.com Tue Apr 16 08:31:10 2013
From: adrian.stern at screenfood.com (Adrian Stern)
Date: Tue Apr 16 08:31:20 2013
Subject: [xsd-users] How to laod a XSD generated class
In-Reply-To:
References:
Message-ID:
Hey Boris
Thanks. I did try this a few minutes back.
When doing this, I get a SIGABRT emmediately.
#include
#include
#include "test.h"
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
auto_ptr s = special_smil_("/tmp/test.xml");
return a.exec();
}
Should I map the parsing functions somehow?
Freundliche Gr?sse / Best Regards / Meilleures salutations
Adrian Stern
-----Original Message-----
From: Boris Kolpackov [mailto:boris@codesynthesis.com]
Sent: 16 April 2013 14:25
To: Adrian Stern
Cc: xsd-users@codesynthesis.com
Subject: Re: [xsd-users] How to laod a XSD generated class
Hi Adrian,
Adrian Stern writes:
> The root element is called special-smil. From this a class named
> special_smil was generated.
>
> [...]
>
> auto_ptr c = special_smil ("c.xml");
If the root type and root element have the same name, then XSD appends an underscore to the parsing/serialization functions (it is a pain in C++ to have both a type and a function with the same name).
So try something like this:
auto_ptr c = special_smil_ ("c.xml");
Boris
Diese E-Mail und ihre Anh?nge enthalten vertrauliche und/oder rechtlich gesch?tzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anh?nge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet.
This e-mail and any attachments may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
From boris at codesynthesis.com Tue Apr 16 08:44:27 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Tue Apr 16 08:44:37 2013
Subject: [xsd-users] How to laod a XSD generated class
In-Reply-To:
References:
Message-ID:
Hi Adrian,
Adrian Stern writes:
> When doing this, I get a SIGABRT emmediately.
>
> [...]
>
> auto_ptr s = special_smil_("/tmp/test.xml");
The parsing function probably throws an exception. Try something
like this (as shown in the examples):
try
{
auto_ptr s = special_smil_("/tmp/test.xml");
}
catch (const xml_schema::exception& e)
{
cerr << e << endl;
return 1;
}
The exception you are getting is probably related to XML schema not
being found. If that's the case, see Section 5.1, "XML Schema Validation
and Searching" in the getting started guide.
Boris
From G.Klima at durst-online.at Tue Apr 23 04:02:51 2013
From: G.Klima at durst-online.at (Klima Georg)
Date: Tue Apr 23 04:03:00 2013
Subject: [xsd-users] abstract type and its c++ equivalent
Message-ID: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
Hello all,
I'm having troubles understanding why an abstract schema type isn't mapped to an abstract / pure virtual / not instantiable class type in c++?
And further why there is a clone method in an abstract type class?
It seems to me that abstract types are instantiable in c++ and I don't understand the reason for this behaviour, since there is no valid schema that could store/serialize this "illegal" instance of an abstract type.
Please help me, I just don't understand it!
My motivation for this problem is that I'm implementing a visitor pattern and so can't implement pure virtual functions within classes of schema abstract types.
Best regards
Georg
From boris at codesynthesis.com Tue Apr 23 10:34:46 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Tue Apr 23 10:34:57 2013
Subject: [xsd-users] abstract type and its c++ equivalent
In-Reply-To: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
References: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
Message-ID:
Hi Georg,
Klima Georg writes:
> I'm having troubles understanding why an abstract schema type isn't
> mapped to an abstract / pure virtual / not instantiable class type
> in c++?
It is not a good idea to add a pure virtual function (e.g., d-tor) to
class that is otherwise non-polymorphic. That would result in code
bloat. However, I don't see any harm in making all its c-tors
protected so that they are inaccessible from user code. I've added
this item to the TODO list for the next release.
> My motivation for this problem is that I'm implementing a visitor
> pattern and so can't implement pure virtual functions within
> classes of schema abstract types.
I don't see why this is a problem. Just leave the "visiting" functions
for abstract types as pure virtual?
Boris
From G.Klima at durst-online.at Tue Apr 23 11:38:10 2013
From: G.Klima at durst-online.at (Klima Georg)
Date: Tue Apr 23 11:38:20 2013
Subject: AW: [xsd-users] abstract type and its c++ equivalent
In-Reply-To:
References: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
Message-ID: <2E884AD3C8BC814186EA906C9C487F2236330E83@ditmail1>
Hi Boris,
Thank you for the fast response!
>> I'm having troubles understanding why an abstract schema type isn't
>> mapped to an abstract / pure virtual / not instantiable class type in
>> c++?
>
>It is not a good idea to add a pure virtual function (e.g., d-tor) to class that is otherwise non-polymorphic. That would result in code bloat. However, I don't see any harm in making all its c-tors >protected so that they are inaccessible from user code. I've added this item to the TODO list for the next release.
>
>
>> My motivation for this problem is that I'm implementing a visitor
>> pattern and so can't implement pure virtual functions within classes
>> of schema abstract types.
>
>I don't see why this is a problem. Just leave the "visiting" functions for abstract types as pure virtual?
Doing so, it didn't compile because of the new/instantiation in the clone function of the "abstract" base type.
But also it may have been caused by another fault of mine too, I forgot to set --polymorphic-type-all!!!
What brings me to another very strange problem:
Setting --polymorphic-type-all enables me what I want to do, implement an intrinsic visitor (accept methods "patched" into the generated code, by sort of aspect oriented programming - introduction).
But even with the clean unmodified/un-patched code I do get an error:
XAlignDescriptorSimpleFrameSample.xml
terminate called after throwing an instance of 'xsd::cxx::tree::no_type_info'
what(): no type information available for a type
if I just do this:
#include // std::auto_ptr
#include
//#include
#include "XAlignDescriptor.hxx"
int main(int argc, char **argv) {
std::cout << argv[1] << std::endl;
std::auto_ptr pd(DPrnCal::PatternDefinition(argv[1])); //<-- exception happens here
// void* i = dynamic_cast(pd.get());
std::cout << "Done." << std::endl;
return 0;
}
Removing the comment from the rtti code, that in effect (at least for this main method) does nothing:
#include // std::auto_ptr
#include
#include
#include "XAlignDescriptor.hxx"
int main(int argc, char **argv) {
std::cout << argv[1] << std::endl;
std::auto_ptr pd(DPrnCal::PatternDefinition(argv[1]));
void* i = dynamic_cast(pd.get());
std::cout << "Done." << std::endl;
return 0;
}
It works with following output:
XAlignDescriptorSimpleFrameSample.xml
Done.
And the pointer i is valid if printed out!
The exception gets thrown in type-factory-map.txx line 401
And I don't understand this behaviour. The only thing I can think of is an initialisation problem concerning the RTTI and derived code!
If you need more info I could send you the schema + xml test files directly, including the xsd parameters used.......
Xsd version: 3.3.0
Xerces version: 3.1.1
Thanks
Georg
From G.Klima at durst-online.at Wed Apr 24 03:17:45 2013
From: G.Klima at durst-online.at (Klima Georg)
Date: Wed Apr 24 03:17:55 2013
Subject: AW: [xsd-users] abstract type and its c++ equivalent
In-Reply-To: <2E884AD3C8BC814186EA906C9C487F2236330E83@ditmail1>
References: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
<2E884AD3C8BC814186EA906C9C487F2236330E83@ditmail1>
Message-ID: <2E884AD3C8BC814186EA906C9C487F2236330E9A@ditmail1>
Hi, just a "minor" correction:
void* i = dynamic_cast(pd.get()); is NOT working, as it would be expected (gets optimized away)
but with std::cout << dynamic_cast(pd.get()) << std::endl; (that isn't optimized away or reorder)
a valid pointer is printed to cout!
Best regards
GEorg
-----Urspr?ngliche Nachricht-----
Von: xsd-users-bounces@codesynthesis.com [mailto:xsd-users-bounces@codesynthesis.com] Im Auftrag von Klima Georg
Gesendet: Dienstag, 23. April 2013 17:38
An: Boris Kolpackov
Cc: xsd-users@codesynthesis.com
Betreff: AW: [xsd-users] abstract type and its c++ equivalent
Hi Boris,
Thank you for the fast response!
>> I'm having troubles understanding why an abstract schema type isn't
>> mapped to an abstract / pure virtual / not instantiable class type in
>> c++?
>
>It is not a good idea to add a pure virtual function (e.g., d-tor) to class that is otherwise non-polymorphic. That would result in code bloat. However, I don't see any harm in making all its c-tors >protected so that they are inaccessible from user code. I've added this item to the TODO list for the next release.
>
>
>> My motivation for this problem is that I'm implementing a visitor
>> pattern and so can't implement pure virtual functions within classes
>> of schema abstract types.
>
>I don't see why this is a problem. Just leave the "visiting" functions for abstract types as pure virtual?
Doing so, it didn't compile because of the new/instantiation in the clone function of the "abstract" base type.
But also it may have been caused by another fault of mine too, I forgot to set --polymorphic-type-all!!!
What brings me to another very strange problem:
Setting --polymorphic-type-all enables me what I want to do, implement an intrinsic visitor (accept methods "patched" into the generated code, by sort of aspect oriented programming - introduction).
But even with the clean unmodified/un-patched code I do get an error:
XAlignDescriptorSimpleFrameSample.xml
terminate called after throwing an instance of 'xsd::cxx::tree::no_type_info'
what(): no type information available for a type
if I just do this:
#include // std::auto_ptr
#include
//#include
#include "XAlignDescriptor.hxx"
int main(int argc, char **argv) {
std::cout << argv[1] << std::endl;
std::auto_ptr pd(DPrnCal::PatternDefinition(argv[1])); //<-- exception happens here
// void* i = dynamic_cast(pd.get());
std::cout << "Done." << std::endl;
return 0;
}
Removing the comment from the rtti code, that in effect (at least for this main method) does nothing:
#include // std::auto_ptr
#include
#include
#include "XAlignDescriptor.hxx"
int main(int argc, char **argv) {
std::cout << argv[1] << std::endl;
std::auto_ptr pd(DPrnCal::PatternDefinition(argv[1]));
void* i = dynamic_cast(pd.get());
std::cout << "Done." << std::endl;
return 0;
}
It works with following output:
XAlignDescriptorSimpleFrameSample.xml
Done.
And the pointer i is valid if printed out!
The exception gets thrown in type-factory-map.txx line 401
And I don't understand this behaviour. The only thing I can think of is an initialisation problem concerning the RTTI and derived code!
If you need more info I could send you the schema + xml test files directly, including the xsd parameters used.......
Xsd version: 3.3.0
Xerces version: 3.1.1
Thanks
Georg
From mjklaim at gmail.com Wed Apr 24 06:20:07 2013
From: mjklaim at gmail.com (=?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?=)
Date: Wed Apr 24 06:20:14 2013
Subject: [xsd-users] abstract type and its c++ equivalent
In-Reply-To: <2E884AD3C8BC814186EA906C9C487F2236330E9A@ditmail1>
References: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
<2E884AD3C8BC814186EA906C9C487F2236330E83@ditmail1>
<2E884AD3C8BC814186EA906C9C487F2236330E9A@ditmail1>
Message-ID:
On Wed, Apr 24, 2013 at 9:17 AM, Klima Georg wrote:
> void* i = dynamic_cast(pd.get()); is NOT
> working, as it would be expected (gets optimized away)
>
> but with std::cout <<
> dynamic_cast(pd.get()) << std::endl; (that
> isn't optimized away or reorder)
> a valid pointer is printed to cout!
>
AFAIK, dynamic_cast can't get optimized away whatever the case...
Joel Lamotte
From boris at codesynthesis.com Wed Apr 24 09:30:58 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Wed Apr 24 09:31:12 2013
Subject: [xsd-users] abstract type and its c++ equivalent
In-Reply-To: <2E884AD3C8BC814186EA906C9C487F2236330E83@ditmail1>
References: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
<2E884AD3C8BC814186EA906C9C487F2236330E83@ditmail1>
Message-ID:
Hi Georg,
Klima Georg writes:
> XAlignDescriptorSimpleFrameSample.xml
> terminate called after throwing an instance of 'xsd::cxx::tree::no_type_info'
> what(): no type information available for a type
This means that there is no C++ type corresponding to the XML Schema
type specified with the xsi:type attribute or used in a substitution
group. Can you make sure that you have compiled all your polymorphic
types as such (--polymorphic-type-all should take care of this) and
also that you actually compile and link all the generated .cxx files
into your application. One common situation where this might not
happen is if you package the generated code into a static (.a)
library.
Boris
From G.Klima at durst-online.at Wed Apr 24 09:39:30 2013
From: G.Klima at durst-online.at (Klima Georg)
Date: Wed Apr 24 09:39:39 2013
Subject: [xsd-users] abstract type and its c++ equivalent
In-Reply-To:
References: <2E884AD3C8BC814186EA906C9C487F2236330E5E@ditmail1>
<2E884AD3C8BC814186EA906C9C487F2236330E83@ditmail1>
Message-ID: <2E884AD3C8BC814186EA906C9C487F2236330EEB@ditmail1>
Hello Boris,
thank you, thats exactly what I do: packaging all xsd generated code into a static library.
This also explains why that dynamic cast helps, it "forces" linkage, that would otherwise be omitted. - My best guess!
Georg
-----Urspr?ngliche Nachricht-----
Von: Boris Kolpackov [mailto:boris@codesynthesis.com]
Gesendet: Mittwoch, 24. April 2013 15:31
An: Klima Georg
Cc: xsd-users@codesynthesis.com
Betreff: Re: [xsd-users] abstract type and its c++ equivalent
Hi Georg,
Klima Georg writes:
> XAlignDescriptorSimpleFrameSample.xml
> terminate called after throwing an instance of 'xsd::cxx::tree::no_type_info'
> what(): no type information available for a type
This means that there is no C++ type corresponding to the XML Schema type specified with the xsi:type attribute or used in a substitution group. Can you make sure that you have compiled all your polymorphic types as such (--polymorphic-type-all should take care of this) and also that you actually compile and link all the generated .cxx files into your application. One common situation where this might not happen is if you package the generated code into a static (.a) library.
Boris
From olitour at gmail.com Fri Apr 26 06:54:47 2013
From: olitour at gmail.com (Olivier Tournaire)
Date: Fri Apr 26 06:55:35 2013
Subject: [xsd-users] Serializing and loading a file throws on windows
In-Reply-To:
References:
Message-ID:
Hi all,
Does anyone have an explanation and a workaround for the aforementioned
problem?
Hope you could help.
Best regards,
Olivier
2013/3/26 Olivier Tournaire
> Hi Boris,
>
>
> 2013/3/25 Boris Kolpackov
>
>> Hi Olivier,
>>
>> Olivier Tournaire writes:
>>
>> > catch (const xml_schema::exception& e)
>> > {
>> > cerr << "Exception caught: " << e.what() << " --> " << e <<
>> endl;
>> > return 1;
>> > }
>> > }
>> >
>> > As commented, when reading the saved model, an error is thrown, only on
>> > windows. Do you have any explanation on why and how to solve this issue?
>>
>> It would be helpful to know what the exception says.
>>
>> Boris
>>
>
> Sorry, I forgive to mention the exception message in my first post. Here
> it is:
>
> Exception caught: instance document parsing failed --> :0:0 error: unable
> to open primary document entity
> 'F:/work/dev/citygml2-0-0/CityGML_2.0.0/Examples/Building_LOD0-4/Building_and_garage_LOD2-EPSG25832_copy_testing.gml'
>
> Regards,
>
> Olivier
>
From Wesley.Peters at tachyon.com Fri Apr 26 14:38:24 2013
From: Wesley.Peters at tachyon.com (Wesley Peters)
Date: Fri Apr 26 14:54:56 2013
Subject: [xsd-users] Serializing and loading a file throws on windows
In-Reply-To:
Message-ID:
It seems that it can't open the specified file for reading. Have you verified the path is correct?
Can you write a stand-alone C++ program that is able to open the file for reading at the given path?
Try cutting and pasting the full filename into a file explorer window.
The forward-slash path name seems suspicious to me, but I'm never sure where Windows will accept those and where it won't.
On 4/26/13 3:54 AM, "Olivier Tournaire" wrote:
Hi all,
Does anyone have an explanation and a workaround for the aforementioned
problem?
Hope you could help.
Best regards,
Olivier
2013/3/26 Olivier Tournaire
> Hi Boris,
>
>
> 2013/3/25 Boris Kolpackov
>
>> Hi Olivier,
>>
>> Olivier Tournaire writes:
>>
>> > catch (const xml_schema::exception& e)
>> > {
>> > cerr << "Exception caught: " << e.what() << " --> " << e <<
>> endl;
>> > return 1;
>> > }
>> > }
>> >
>> > As commented, when reading the saved model, an error is thrown, only on
>> > windows. Do you have any explanation on why and how to solve this issue?
>>
>> It would be helpful to know what the exception says.
>>
>> Boris
>>
>
> Sorry, I forgive to mention the exception message in my first post. Here
> it is:
>
> Exception caught: instance document parsing failed --> :0:0 error: unable
> to open primary document entity
> 'F:/work/dev/citygml2-0-0/CityGML_2.0.0/Examples/Building_LOD0-4/Building_and_garage_LOD2-EPSG25832_copy_testing.gml'
>
> Regards,
>
> Olivier
>
________________________________
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 erik.sjolund at gmail.com Sat Apr 27 03:16:12 2013
From: erik.sjolund at gmail.com (=?ISO-8859-1?Q?Erik_Sj=F6lund?=)
Date: Sat Apr 27 03:16:19 2013
Subject: [xsd-users] is "warning T005" really needed? (use
--polymorphic-type to indicate this type is polymorphic ...)
Message-ID:
Hi,
Just sharing some thoughts about the command line user interface for
CodeSynthesis XSD.
I wonder if this type of warning is really needed?
info: use --polymorphic-type to indicate this type is polymorphic when
compiling schemas that reference it
/dev/shm/build1/person.xsd:23:44: warning T005: assuming type 'personType'
is polymorphic
I could add "--polymorphic-type personType" for the polymorphic type that
is referenced from the imported schema but that seems to break the DRY
principle
http://en.wikipedia.org/wiki/Don't_repeat_yourself
(and more importantly it makes it more difficult for me to use some CMake
macros that I wrote for creating a dynamically loaded plugin)
My program compiles and runs just fine but I get a number of warnings
during the build because of this.
Maybe it would be better to add a command line option --debug where this
warning could be printed?
cheers,
Erik Sj?lund
From G.Klima at durst-online.at Sat Apr 27 15:58:17 2013
From: G.Klima at durst-online.at (Klima Georg)
Date: Sat Apr 27 15:58:28 2013
Subject: [xsd-users] undefined references after extending the tree
custumization to further types
Message-ID: <2E884AD3C8BC814186EA906C9C487F2236330FA3@ditmail1>
Hi members,
I'm using tree customisation for some types already without any troubles.
But since I tried to extend the customisation for other types too I do get link erros:
Linking CXX executable schema_test
cd /home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema && /home/gklima/projects/support_sw/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/schema_test.dir/link.txt --verbose=1
/usr/bin/c++ -fmessage-length=0 -g CMakeFiles/schema_test.dir/schema_test.cpp.o CMakeFiles/schema_test.dir/XAlignDescriptor.cxx.o CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o CMakeFiles/schema_test.dir/pd-custom.cpp.o -o schema_test -L/home/gklima/projects/support_sw/log4cplus/1.1.0/lib -L/home/gklima/projects/support_sw/qextserialport/1.2rc/lib -L/opt/halcon11/lib/x64-linux2.4-gcc40 -rdynamic /home/gklima/projects/support_sw/xerces-c/3.1.1/lib/libxerces-c-3.1.so -Wl,-rpath,/home/gklima/projects/support_sw/log4cplus/1.1.0/lib:/home/gklima/projects/support_sw/qextserialport/1.2rc/lib:/opt/halcon11/lib/x64-linux2.4-gcc40:/home/gklima/projects/support_sw/xerces-c/3.1.1/lib
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `pointLocation_base':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1103: undefined reference to `DPrnCal::location_impl::location_impl()'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1113: undefined reference to `DPrnCal::location_impl::location_impl(DPrnCal::location_impl const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1123: undefined reference to `DPrnCal::location_impl::location_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1123: undefined reference to `DPrnCal::location_impl::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `~pointLocation_base':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1178: undefined reference to `DPrnCal::location_impl::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `roiLocation_vt':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1202: undefined reference to `DPrnCal::location_impl::location_impl()'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1216: undefined reference to `DPrnCal::location_impl::location_impl(DPrnCal::location_impl const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1230: undefined reference to `DPrnCal::location_impl::location_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1230: undefined reference to `DPrnCal::location_impl::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `~roiLocation_vt':
/home/gklima/projects/printerCalibration_build/lib/patternDescriptor/schema/PatternDescriptorDT.cxx:1333: undefined reference to `DPrnCal::location_impl::~location_impl()'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `std::auto_ptr xsd::cxx::tree::factory_impl >(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)':
/home/gklima/projects/support_sw/xsd/3.3.0-2/include/xsd/cxx/tree/type-factory-map.txx:434: undefined reference to `DPrnCal::pointLocation_impl::pointLocation_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
CMakeFiles/schema_test.dir/PatternDescriptorDT.cxx.o: In function `std::auto_ptr xsd::cxx::tree::factory_impl >(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)':
/home/gklima/projects/support_sw/xsd/3.3.0-2/include/xsd/cxx/tree/type-factory-map.txx:434: undefined reference to `DPrnCal::location_impl::location_impl(xercesc_3_1::DOMElement const&, xsd::cxx::tree::flags, xsd::cxx::tree::_type*)'
collect2: ld gab 1 als Ende-Status zur?ck
make[2]: *** [lib/patternDescriptor/schema/schema_test] Fehler 1
make[2]: Verlasse Verzeichnis '/home/gklima/projects/printerCalibration_build'
make[1]: *** [lib/patternDescriptor/schema/CMakeFiles/schema_test.dir/all] Fehler 2
make[1]: Verlasse Verzeichnis '/home/gklima/projects/printerCalibration_build'
make: *** [all] Fehler 2
xsd options:
--generate-polymorphic
--polymorphic-type-all
--custom-type location_at=location_impl/location_base
--custom-type pointLocation_vt=pointLocation_impl/pointLocation_base
--generate-forward
--fwd-prologue #include "pd-custom-fwd.hpp"
--hxx-prologue #include "pd-custom.hpp"
FILE pd-custom-fwd.hpp:
namespace DPrnCal {
//template class xalignDescriptor_impl;
//template class xalignReference_impl;
//template class xalignMeasurement_impl;
//template class pointLocation_impl;
//template class roiLocation_impl;
//template class droplet_impl;
//template class dropletSegment_impl;
//template class segment_impl;
//template class simpleFrame_impl;
//template class doubleFrame_impl;
//template class frameReference_impl;
//template class patternDescriptor_impl;
template class location_impl;
template class pointLocation_impl;
} // namespace DPrnCal
FILE pd-custom.hpp:
#include "PatternDescriptorDT-fwd.hxx"
namespace DPrnCal {
template class location_impl: public base
{
public:
location_impl ();
location_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
location_impl (const ::xercesc::DOMAttr& a,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
location_impl (const ::std::string& s,
const ::xercesc::DOMElement* e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
location_impl (const location_impl& x,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
virtual location_impl*
_clone (::xml_schema::flags f = 0,
::xml_schema::container* c = 0) const;
virtual
~location_impl ();
};
template class pointLocation_impl: public base
{
public:
pointLocation_impl (typename base::x_type const &,
typename base::yIdx_type const &);
pointLocation_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
pointLocation_impl (const pointLocation_impl& x,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
virtual pointLocation_impl*
_clone (::xml_schema::flags f = 0,
::xml_schema::container* c = 0) const;
virtual
~pointLocation_impl ();
};
} /* namespace DPrnCal */
FILE pd-custorm.cpp
#include "pd-custom.hpp"
namespace DPrnCal {
template location_impl::location_impl():base(){}
template location_impl::location_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f ,
::xml_schema::container* c):base(e,f,c) {}
template location_impl::location_impl (const ::xercesc::DOMAttr& a,
::xml_schema::flags f ,
::xml_schema::container* c ):base(a,f,c) {}
template location_impl::location_impl (const ::std::string& s,
const ::xercesc::DOMElement* e,
::xml_schema::flags f,
::xml_schema::container* c):base(e,f,c) {}
template location_impl::location_impl (const location_impl& x,
::xml_schema::flags f,
::xml_schema::container* c):base(x,f,c) {}
template location_impl * location_impl::_clone (::xml_schema::flags f,
::xml_schema::container* c) const
{
return new location_impl(*this, f,c);
}
template location_impl::~location_impl () {}
//--------------------------------------------------------------------------------------------------------
template pointLocation_impl::pointLocation_impl ( typename base::x_type const & a,
typename base::yIdx_type const & b):base(a,b){}
template pointLocation_impl::pointLocation_impl (const ::xercesc::DOMElement& e,
::xml_schema::flags f,
::xml_schema::container* c):base(e,f,c){}
template pointLocation_impl::pointLocation_impl (const pointLocation_impl& x,
::xml_schema::flags f,
::xml_schema::container* c):base(x,f,c){}
template pointLocation_impl * pointLocation_impl::_clone (::xml_schema::flags f,
::xml_schema::container* c) const {
return pointLocation_impl(*this, f,c);
}
template pointLocation_impl::~pointLocation_impl () {}
} /* namespace DPrnCal */
If I remove the pointLocation customisation there are no errors anymore!!!!!!!
Be aware I remove pointLocation and not location for which link errors existed. But then the errors are gone!
gcc-Version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
Please, I don't have any clue what I'm doing wrong!
Best regards
Georg
From boris at codesynthesis.com Sun Apr 28 09:08:52 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Sun Apr 28 09:09:17 2013
Subject: [xsd-users] is "warning T005" really needed? (use
--polymorphic-type to indicate this type is polymorphic ...)
In-Reply-To:
References:
Message-ID:
Hi Erik,
Erik Sj?lund writes:
> I wonder if this type of warning is really needed?
>
> info: use --polymorphic-type to indicate this type is polymorphic when
> compiling schemas that reference it
> /dev/shm/build1/person.xsd:23:44: warning T005: assuming type 'personType'
> is polymorphic
XSD issues this warning if a type is used in a substitution group
and the type and substitution group are defined in different files.
Without the --polymorphic-type option when compiling the schema
defining the type, XSD will treat it as non-polymorphic.
You can also suppress the warning by passing --disable-warning T005.
Boris
From boris at codesynthesis.com Sun Apr 28 09:19:44 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Sun Apr 28 09:20:10 2013
Subject: [xsd-users] undefined references after extending the tree
custumization to further types
In-Reply-To: <2E884AD3C8BC814186EA906C9C487F2236330FA3@ditmail1>
References: <2E884AD3C8BC814186EA906C9C487F2236330FA3@ditmail1>
Message-ID:
Hi Georg,
Klima Georg writes:
> FILE pd-custorm.cpp
>
> #include "pd-custom.hpp"
>
> namespace DPrnCal {
>
> template location_impl::location_impl():base(){}
>
> [...]
If you re-read the customization guide more carefully, you will notice
that besides the class template implementation, it also contains the
explicit instantiation requests, for example:
// Explicitly instantiate person_impl class template for person_base.
//
template class person_impl;
So in your case you need to add something along those lines:
template class location_impl;
template class pointLocation_impl;
Boris
From boris at codesynthesis.com Sun Apr 28 09:29:28 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Sun Apr 28 09:29:40 2013
Subject: [xsd-users] Serializing and loading a file throws on windows
In-Reply-To:
References:
Message-ID:
Hi Olivier,
Olivier Tournaire writes:
> > Exception caught: instance document parsing failed --> :0:0 error: unable
> > to open primary document entity
> > 'F:/work/dev/citygml2-0-0/CityGML_2.0.0/Examples/Building_LOD0-4/Building_and_garage_LOD2-EPSG25832_copy_testing.gml'
The first argument to the parsing function is a URI. On Unix, this doesn't
cause any problems since paths don't normally contain colons. On Windows,
however, an absolute path contains the drive prefix which makes it an
invalid URI. To fix this, add "file:///" to the paths that you pass to
parsing functions:
file:///F:/work/dev/citygml2-0-0/CityGML_2.0.0/Examples/Building_LOD0-4/Building_and_garage_LOD2-EPSG25832_copy_testing.gml
Boris
From olitour at gmail.com Tue Apr 30 05:22:29 2013
From: olitour at gmail.com (Olivier Tournaire)
Date: Tue Apr 30 05:23:17 2013
Subject: [xsd-users] [xsd cxx-tree] Serialization progress callback
Message-ID:
Hi,
Is there any way to have a progress callback when serializing (reading /
writing) a file?
Regards,
Olivier
From olitour at gmail.com Tue Apr 30 05:24:13 2013
From: olitour at gmail.com (Olivier Tournaire)
Date: Tue Apr 30 05:25:00 2013
Subject: [xsd-users] Serializing and loading a file throws on windows
In-Reply-To:
References:
Message-ID:
Thanks,
Will have a look at it and let you know if it works.
Regards,
Olivier
2013/4/28 Boris Kolpackov
> Hi Olivier,
>
> Olivier Tournaire writes:
>
> > > Exception caught: instance document parsing failed --> :0:0 error:
> unable
> > > to open primary document entity
> > >
> 'F:/work/dev/citygml2-0-0/CityGML_2.0.0/Examples/Building_LOD0-4/Building_and_garage_LOD2-EPSG25832_copy_testing.gml'
>
> The first argument to the parsing function is a URI. On Unix, this doesn't
> cause any problems since paths don't normally contain colons. On Windows,
> however, an absolute path contains the drive prefix which makes it an
> invalid URI. To fix this, add "file:///" to the paths that you pass to
> parsing functions:
>
>
> file:///F:/work/dev/citygml2-0-0/CityGML_2.0.0/Examples/Building_LOD0-4/Building_and_garage_LOD2-EPSG25832_copy_testing.gml
>
> Boris
>
From boris at codesynthesis.com Tue Apr 30 09:08:53 2013
From: boris at codesynthesis.com (Boris Kolpackov)
Date: Tue Apr 30 09:08:59 2013
Subject: [xsd-users] [xsd cxx-tree] Serialization progress callback
In-Reply-To:
References:
Message-ID:
Hi Olivier,
Olivier Tournaire writes:
> Is there any way to have a progress callback when serializing (reading /
> writing) a file?
No, there is no callback. But a document can be parsed/serialized in
chunks which would allow you to provide some form of a progress. See
the 'streaming' example for details.
Boris