From victor.fine at gmail.com Mon Oct 7 04:56:52 2013 From: victor.fine at gmail.com (Victor Fine) Date: Mon Oct 7 04:57:00 2013 Subject: [xsd-users] Writing doubles with decimal point Message-ID: Hello all, I need to output double values with decimal point even when they are integers. e.g. "9.0" instead of "9". Do you have any ideas ? Best regards, Victor. From boris at codesynthesis.com Mon Oct 7 07:12:24 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 7 07:14:48 2013 Subject: [xsd-users] Writing doubles with decimal point In-Reply-To: References: Message-ID: Hi Victor, Victor Fine writes: > I need to output double values with decimal point even when they are > integers. e.g. "9.0" instead of "9". Do you have any ideas ? You can achieve this with type customization. See the C++/Tree Mapping Customization Guide: http://wiki.codesynthesis.com/Tree/Customization_guide As well as the examples in the examples/cxx/tree/custom/ directory. In fact, the 'double' example does pretty much what you want. Boris From xsd at cloudydaze.co.uk Thu Oct 10 10:50:55 2013 From: xsd at cloudydaze.co.uk (Damon Southworth) Date: Thu Oct 10 10:51:13 2013 Subject: [xsd-users] Support for a sequence of choice elements of polymorphic type Message-ID: <5256BECF.8060307@cloudydaze.co.uk> Hi This is my first post to this site. I have been looking at a number of posts with similar problems to mine with maintaining sequencing information reqarding the sequence of choice elements type data. My question though is a little bit different. Like a previous post I have a part in my xsd schema that looks like this .... In the xsd data model, my list is currently represented as a number of separate lists; One list with the Element_A types and one list with the Element_B types and so on. This implementation loses the sequence information as reported by other posts. However, both Element_A_Type and Element_B_Types etc. all have a common parent class. and... For this type of schema definition the Java XML compiler Jaxb produces a single list of the polymorphic parent typeElement_Type to represent this sequence. Can the xsd cxx XML compiler also produce a single list of objects with a type of the common parent class for the polymorphic choices with a common parent class rather than a sperate list of each choice.? This would also allow the sequence information to be retained. Regards, Damon Southworth -- Damon Southworth From boris at codesynthesis.com Thu Oct 10 11:50:43 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Oct 10 11:53:08 2013 Subject: [xsd-users] Support for a sequence of choice elements of polymorphic type In-Reply-To: <5256BECF.8060307@cloudydaze.co.uk> References: <5256BECF.8060307@cloudydaze.co.uk> Message-ID: Hi Damon, Damon Southworth writes: > Can the xsd cxx XML compiler also produce a single list of objects > with a type of the common parent class for the polymorphic choices > with a common parent class rather than a sperate list of each > choice.? Yes, but you will need to modify the schema a bit (you can do it only for the XSD-to-C++ compilation): you will need to create an abstract substitution group root element (of type Element_Type) and use it as the only element in MyListType. Then derive Element_A and Element_B from this root element (in the substitution groups sense). This way they can be substituted for the element in MyListType. Once this is done, compile your schema with the --generate-polymorphic --polymorphic-type Element_Type options, and you will get a sequence that will contain either Element_A or Element_B, polymorphically Boris From xsd at cloudydaze.co.uk Thu Oct 10 12:29:59 2013 From: xsd at cloudydaze.co.uk (Damon Southworth) Date: Thu Oct 10 12:30:14 2013 Subject: [xsd-users] Support for a sequence of choice elements of polymorphic type In-Reply-To: References: <5256BECF.8060307@cloudydaze.co.uk> Message-ID: <5256D607.1010707@cloudydaze.co.uk> On 10/10/13 16:50, Boris Kolpackov wrote: > Hi Damon, > > Damon Southworth writes: > >> Can the xsd cxx XML compiler also produce a single list of objects >> with a type of the common parent class for the polymorphic choices >> with a common parent class rather than a sperate list of each >> choice.? > On 10/10/13 16:50, Boris Kolpackov wrote: > > Yes, but you will need to modify the schema a bit (you can do it > only for the XSD-to-C++ compilation): you will need to create > an abstract substitution group root element (of type Element_Type) > and use it as the only element in MyListType. Then derive Element_A > and Element_B from this root element (in the substitution groups > sense). This way they can be substituted for the element in > MyListType. Once this is done, compile your schema with the > --generate-polymorphic --polymorphic-type Element_Type options, > and you will get a sequence that will contain either Element_A > or Element_B, polymorphically Thanks. Yes, I already tried this and it does works but does it not also means that the xml source needs to change too? Originally the xml source would look like this: ... whereas now it would look like this ... thus moving the list element type mapping from the schema into the xml source? Damon. -- Damon Southworth From boris at codesynthesis.com Thu Oct 10 13:21:53 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Oct 10 13:24:18 2013 Subject: [xsd-users] Support for a sequence of choice elements of polymorphic type In-Reply-To: <5256D607.1010707@cloudydaze.co.uk> References: <5256BECF.8060307@cloudydaze.co.uk> <5256D607.1010707@cloudydaze.co.uk> Message-ID: Hi Damon, Damon Southworth writes: > Yes, I already tried this and it does works but does it not > also means that the xml source needs to change too? No, the two schemas are semantically equivalent from the XML instance point of view. > Originally the xml source would look like this: > > > > > ... > > > whereas now it would look like this > > > > > ... > > > thus moving the list element type mapping from the schema into the > xml source? No, if you use a substitution group, then you don't need xsi:type. Boris From xsd at cloudydaze.co.uk Fri Oct 11 04:35:20 2013 From: xsd at cloudydaze.co.uk (Damon Southworth) Date: Fri Oct 11 04:35:33 2013 Subject: [xsd-users] Support for a sequence of choice elements of polymorphic type In-Reply-To: References: <5256BECF.8060307@cloudydaze.co.uk> <5256D607.1010707@cloudydaze.co.uk> Message-ID: <5257B848.8010005@cloudydaze.co.uk> Hi Boris, > > On 10 Oct 2013, at 18:21, Boris Kolpackov wrote: > > No, the two schemas are semantically equivalent from the XML > instance point of view. > >> Originally the xml source would look like this: >> >> >> >> >> ... >> >> >> whereas now it would look like this >> >> >> >> >> ... >> >> >> thus moving the list element type mapping from the schema into the >> xml source? > > No, if you use a substitution group, then you don't need xsi:type. > > Boris Right, I see what you mean now. I hadn't used substitutionGroup before. That should work to allow me to generate code to read the syntactically eqivalent xml. Thanks, Damon. -- Damon Southworth From bamartos at gmail.com Tue Oct 15 12:14:29 2013 From: bamartos at gmail.com (Vasileios Martos) Date: Tue Oct 15 12:14:57 2013 Subject: [xsd-users] Unable to create a DLL Message-ID: Hello, I followed the instructions at the wiki page ( http://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio#Creating_a_DLL ) in order to create a .dll for my schema. When I tried to build my project the the build was succeeded but there was no any .dll file in my output folder. The command line in the "C++/Tree Mapping Option is: xsd.exe cxx-tree --output-dir "\*myCustomPath*\\" --hxx-suffix ".hxx" --cxx-suffix ".cxx" --ixx-suffix ".ixx" --fwd-suffix "-fwd.hxx" --export-symbol "XSD_DLL_EXPORTS" + the Additional Options: --hxx-prologue "#include \"export.hxx\"" While in the export.hxx I have only the definitions: #ifdef XSD_DLL_EXPORTS #define XSD_DLL_SYMBOL_DECL __declspec(dllexport) #else #define XSD_DLL_SYMBOL_DECL __declspec(dllimport) #endif After the build it says that "Build succeeded" but in the "\*myCustomPath*\\" output dir are only the generated .hxx and .cpp files and not the .dll Did I forget anything? Thank you, vasma From boris at codesynthesis.com Wed Oct 16 01:55:24 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 16 01:57:47 2013 Subject: [xsd-users] Unable to create a DLL In-Reply-To: References: Message-ID: Hi Vasileios, Vasileios Martos writes: > When I tried to build my project the the build was succeeded but there > was no any .dll file in my output folder. > > xsd.exe cxx-tree --output-dir "\*myCustomPath*\\" ... > > After the build it says that "Build succeeded" but in the "\*myCustomPath*\\" > output dir are only the generated .hxx and .cpp files and not the .dll The DLL is not built by the XSD compiler, it is built by VC++. Normally it will be placed into the Debug, Release, x64/Debug, or x64/Release sub-directories in your VC++ solution. Note also that this is not related to XSD but rather to VC++ (or your lack of understanding how building of DLLs works in VC++). For this kind of questions please use other forums, such as the ones found on MSDN. Boris From olitour at gmail.com Fri Oct 25 03:32:49 2013 From: olitour at gmail.com (Olivier Tournaire) Date: Fri Oct 25 03:33:37 2013 Subject: [xsd-users] Serializing and loading a file throws on windows In-Reply-To: References: Message-ID: Hi, It turns out that it was not a problem with "file:///" or whatever. On Windows, simply closing the fstream before trying to read drops the exception. Regards, Olivier 2013/4/30 Olivier Tournaire > 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 thibaud.rouille at fr.thalesgroup.com Tue Oct 29 13:07:35 2013 From: thibaud.rouille at fr.thalesgroup.com (ROUILLE Thibaud) Date: Tue Oct 29 13:07:45 2013 Subject: [xsd-users] Not working example Message-ID: <22618_1383066457_526FEB59_22618_8418_1_9918612548E85A4A84A5A497BCCB39A6010A15A5E6B9@THSONEA01CMS02P.one.grp> Hello, I'm currently testing Code Synthesis XSD. I found one interesting example for me, named "Create Object Model from Document Fragment" which can be seen on this page : http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/dbxml/ The asNode() method doesn't exists anymore in Berkley DbXml. Is there another way to do the same example ? Thanks [@@ THALES GROUP INTERNAL @@] From boris at codesynthesis.com Wed Oct 30 00:55:43 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 30 00:58:06 2013 Subject: [xsd-users] Re: XSD for visual studio 2012 In-Reply-To: References: Message-ID: Hi Colin, Also, in the future, please send technical questions like these to the xsd-users mailing list (which I've CC'ed) instead of to me directly, as discussed in the posting guidelines: http://www.codesynthesis.com/support/posting-guidelines.xhtml JinhuaColin Huang writes: > Hi, i downloaded XSD 64 bit for vs2010. But I am wondering whether > it is ok to use with vs2010. Yes, a lot of people are using XSD with VS 2012 without any problems. Boris From boris at codesynthesis.com Wed Oct 30 01:19:39 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 30 01:22:04 2013 Subject: [xsd-users] Not working example In-Reply-To: <22618_1383066457_526FEB59_22618_8418_1_9918612548E85A4A84A5A497BCCB39A6010A15A5E6B9@THSONEA01CMS02P.one.grp> References: <22618_1383066457_526FEB59_22618_8418_1_9918612548E85A4A84A5A497BCCB39A6010A15A5E6B9@THSONEA01CMS02P.one.grp> Message-ID: Hi Thibaud, ROUILLE Thibaud writes: > The asNode() method doesn't exists anymore in Berkley DbXml. Yes, unfortunately, the Berkley DBXML developers went way from exposing the XML content as Xerces-C++ DOM nodes and instead decided to use a streaming model (i.e., XML reader/writer). The new model, however, does not allow for tight integration with XSD, that you can see in the examples (it is both convenient and fast). We have had a long discussion with the DBXML folks but unfortunately they insisted on only having the reader/writer interface. As a result, we will be no longer supporting DBXML and XSD integration in the future. Which is a pity since it worked quite well. Boris