From miaowang.tw at gmail.com Sat Dec 4 04:13:50 2021 From: miaowang.tw at gmail.com (Miao Wang) Date: Mon Dec 6 08:32:28 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 Message-ID: Hi All, I am trying to parse CityGML data using CodeSynthesis XSD. The xsd files was downloaded from the link below: http://wiki.codesynthesis.com/Schemas/CityGML Using XSD 3.3.0 and following the instructions of the link, all works fine. But when I change to use XSD 4.1.0.a11 to generate c++ code, the tag cannot be find correctly and thus got nothing in . This maybe the same problem with the link: https://www.codesynthesis.com/pipermail/xsd-users/2017-November/004946.html But no additional solution can be found. Can anyone help to solve this problem? ?????www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> From boris at codesynthesis.com Wed Dec 8 02:16:45 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Dec 8 02:14:24 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Miao Wang writes: > Using XSD 3.3.0 and following the instructions of the link, all works fine. > But when I change to use XSD 4.1.0.a11 to generate c++ code, the > tag cannot be find correctly and thus got nothing in > . > This maybe the same problem with the link: > https://www.codesynthesis.com/pipermail/xsd-users/2017-November/004946.html It does look similar but unfortunately the original reporter didn't try to get to the bottom of the issue. Seeing that you have both working and non-working builds available, can you try to step through the relevant parsing code with the debugger and see where things differ? My hunch is that this has something to do with polymorphism/substitution groups. One related thing worth checking is that the --generate-polymorphic and --polymorphic-type* options (and potentially --export-maps, if the generated code is split into DLLs) present and make sense. From miaowang.tw at gmail.com Thu Dec 9 02:44:45 2021 From: miaowang.tw at gmail.com (Miao Wang) Date: Thu Dec 9 05:31:32 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Hello Boris, Thank you for the reply. Some information has to be corrected first: 1. The version of CityGML xsd is 2.0, downloaded from the OGC website. 2. The test gml file is downloaded from the OGC website too. 3. XSD versions for testing are 4.0.0 and 4.1.0.a11. Ver.4.0.0 generates the working code but ver.4.1.0.a11 no. (The parameters for generating C++ code using XSD for both Ver.4.0 and Ver.4.1 are the same) The test CityGML files and the generated codes can be found from the following link. https://drive.google.com/file/d/1t-F3U14bLN3nQsfUGsyYksj8xwe6UM7P/view?usp=sharing Step into the code of V4.1, the differences are found: a. At line 532 of [feature.cxx], to create [_Feature]. b. Step into the create(), at line 274 of [type-factory-map.txx], and run to line 304: if (i != element_map_.end ()) { f = find_substitution (i->second, qn); } here, qn.name = "Building", and the value of [f] is 0, which means the tag "Building" can not be found? [element_map_] has 4 elements: Address Appearance FeatureCollection Observation But for V4.0, [element_map_] has 4 additional elements: _CityObject _Coverage _FeatureCollection _SurfaceData so [f] got something (substitution of "Building"?) and the code works. Hope the information is enough to solve the problem. BTW, XSD is amazing and wonderful, it helps my work on writing KML, DAE and OpenDrive files. BR Miao ?????www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> Boris Kolpackov ? 2021?12?8? ?? ??3:16??? > Miao Wang writes: > > > Using XSD 3.3.0 and following the instructions of the link, all works > fine. > > But when I change to use XSD 4.1.0.a11 to generate c++ code, the > > tag cannot be find correctly and thus got nothing in > > . > > This maybe the same problem with the link: > > > https://www.codesynthesis.com/pipermail/xsd-users/2017-November/004946.html > > It does look similar but unfortunately the original reporter didn't > try to get to the bottom of the issue. > > Seeing that you have both working and non-working builds available, > can you try to step through the relevant parsing code with the debugger > and see where things differ? My hunch is that this has something to > do with polymorphism/substitution groups. One related thing worth > checking is that the --generate-polymorphic and --polymorphic-type* > options (and potentially --export-maps, if the generated code is > split into DLLs) present and make sense. > From Yan.Zhang at navcanada.ca Thu Dec 9 14:20:20 2021 From: Yan.Zhang at navcanada.ca (Zhang, Yan) Date: Fri Dec 10 06:14:47 2021 Subject: [xsd-users] setValidationScheme Message-ID: Hello there, I got this email address from my colleague. We're trying to understand the following method: setValidationScheme This method allows users to set the validation scheme to be used by this parser. The value is one of the ValSchemes enumerated values defined by this class: Val_Never - turn off validation Val_Always - turn on validation Val_Auto - turn on validation if any internal/external DTD subset have been seen The parser's default state is: Val_Never. Parameters newScheme The new validation scheme to use. We found that if we set this to Val_Always, the name space and the xsd location are required in the data. Here is an example: Xsd: Xml Data: "ITS.xsd" >
NIL
After calling setValidationScheme with Val_Always, the highlighted attributes in the data are required to pass the validation, while calling with Val_Never, the highlighted attributes can be removed without causing the validation failure. Is it OK to set to Val_Never in this case? Thanks in advance, Yan Zhang ________________________________ This electronic message, as well as any transmitted files included in the electronic message, may contain privileged or confidential information and is intended solely for the use of the individual(s) or entity to which it is addressed. If you have received this electronic message in error please notify the sender immediately and delete the electronic message. Any unauthorized copying, disclosure or distribution of the electronic message is strictly forbidden. NAV CANADA accepts no liability for any damage caused by any virus and/or other malicious code transmitted by this electronic communication. Le pr?sent message ?lectronique et tout fichier qui peut y ?tre joint peuvent contenir des renseignements privil?gi?s ou confidentiels destin?s ? l'usage exclusif des personnes ou des organismes ? qui ils s'adressent. Si vous avez re?u ce message ?lectronique par erreur, veuillez en informer l'exp?diteur imm?diatement et supprimez le. Toute reproduction, divulgation ou distribution du pr?sent message ?lectronique est strictement interdite. NAV CANADA n'assume aucune responsabilit? en cas de dommage caus? par tout virus ou autre programme malveillant transmis par ce message ?lectronique. From boris at codesynthesis.com Fri Dec 10 06:49:19 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 10 06:46:54 2021 Subject: [xsd-users] setValidationScheme In-Reply-To: References: Message-ID: Zhang, Yan writes: > We're trying to understand the following method: setValidationScheme > This question is about Xerces-C++. Can you provide more context on how this fits with the XSD compiler/runtime usage? From boris at codesynthesis.com Fri Dec 10 07:47:30 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 10 07:45:05 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Miao Wang writes: > Step into the code of V4.1, the differences are found: [...] Thanks for digging into this. I've now figured out and fixed this bug: https://scm.codesynthesis.com/cgit/xsd/xsd/commit/?id=2a700917616a In a nutshell, after the 4.0.0 release there was work done to omit certain parts of the generated code for abstract types and elements. But it turns out we went a bit too far and we still need some things even for abstract elements. I've also now released a new beta version with this fix. If you would like, you can try it by following these instructions: https://codesynthesis.com/products/xsd/doc/install-build2.xhtml From Yan.Zhang at navcanada.ca Fri Dec 10 08:18:56 2021 From: Yan.Zhang at navcanada.ca (Zhang, Yan) Date: Sat Dec 11 07:44:07 2021 Subject: [xsd-users] setValidationScheme In-Reply-To: References: Message-ID: Hi Boris, Thank you for your quick response, maybe I post my question to a wrong place? My colleague recommended me to send xml parser related question here. Sorry for the inconvenience. BR, Yan -----Original Message----- From: Boris Kolpackov Sent: Friday, December 10, 2021 6:49 AM To: Zhang, Yan Cc: xsd-users@codesynthesis.com Subject: [EXT] Re: [xsd-users] setValidationScheme CAUTION: This email originated from outside of the organization. If you do not recognize the sender or you are not certain the content is safe, then do not click on any links or open any attachments. AVERTISSEMENT : Ce courriel provient d?une source externe ? l?organisation. Si vous ne reconnaissez pas l?exp?diteur ou si vous doutez de la s?curit? du contenu, ne cliquez sur aucun lien et n?ouvrez aucune pi?ce jointe. Zhang, Yan writes: > We're trying to understand the following method: setValidationScheme > > s-3/classSAXParser.html*ac8aec6a77c18efccbf799123311047d1__;Iw!!P0kg3Y > azkQ!QxC5-MKdqVs6hWiRIRdc2N5xQKoO53s3kkNPMKdkd7nFd7HlX8V9MbpdeI_rWJeFn > qGQ$ > This question is about Xerces-C++. Can you provide more context on how this fits with the XSD compiler/runtime usage? ________________________________ This electronic message, as well as any transmitted files included in the electronic message, may contain privileged or confidential information and is intended solely for the use of the individual(s) or entity to which it is addressed. If you have received this electronic message in error please notify the sender immediately and delete the electronic message. Any unauthorized copying, disclosure or distribution of the electronic message is strictly forbidden. NAV CANADA accepts no liability for any damage caused by any virus and/or other malicious code transmitted by this electronic communication. Le pr?sent message ?lectronique et tout fichier qui peut y ?tre joint peuvent contenir des renseignements privil?gi?s ou confidentiels destin?s ? l?usage exclusif des personnes ou des organismes ? qui ils s?adressent. Si vous avez re?u ce message ?lectronique par erreur, veuillez en informer l?exp?diteur imm?diatement et supprimez le. Toute reproduction, divulgation ou distribution du pr?sent message ?lectronique est strictement interdite. NAV CANADA n?assume aucune responsabilit? en cas de dommage caus? par tout virus ou autre programme malveillant transmis par ce message ?lectronique. From miaowang.tw at gmail.com Sat Dec 11 05:15:31 2021 From: miaowang.tw at gmail.com (Miao Wang) Date: Sat Dec 11 07:44:07 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Hello Boris, Thanks for the update. However, because I never use build2 before, after trying all the day, I failed to build the XSD for Windows 10 following the instructions. Could you make it for me to test? Miao ?????www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> Boris Kolpackov ? 2021?12?10? ?? ??8:47??? > Miao Wang writes: > > > Step into the code of V4.1, the differences are found: [...] > > Thanks for digging into this. I've now figured out and fixed this > bug: > > https://scm.codesynthesis.com/cgit/xsd/xsd/commit/?id=2a700917616a > > In a nutshell, after the 4.0.0 release there was work done to > omit certain parts of the generated code for abstract types and > elements. But it turns out we went a bit too far and we still need > some things even for abstract elements. > > I've also now released a new beta version with this fix. If you > would like, you can try it by following these instructions: > > https://codesynthesis.com/products/xsd/doc/install-build2.xhtml > From boris at codesynthesis.com Sat Dec 11 08:00:37 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sat Dec 11 07:58:12 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Miao Wang writes: > However, because I never use build2 before, after trying all the day, I > failed to build the XSD for Windows 10 following the instructions. > Could you make it for me to test? Unfortunately not: we are moving away from manually building binaries since it's not sustainable. But if you can tell me what exactly didn't work with the build2 approach, I would be happy to help. From miaowang.tw at gmail.com Sat Dec 11 22:47:25 2021 From: miaowang.tw at gmail.com (Miao Wang) Date: Mon Dec 13 05:59:41 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Hello Boris, Finally, I success in building XSD after modifying the followings for [config.build]: 1. config.cxx.coptions = /O2 /wd"4819" //(it's an O, not a zero, I made a mistake. And disable warning 4819 for encoding problem) 2. config.install.root=C:/xsd //( not C:\xsd as in the instruction) Then the c++ code for CityGML 2.0 was generated using the newly built Ver. 4.2.0-b.3. When compiling the generated code using MSVC, it shows the error at the generated .hxx files: C1083: 'xsd/cxx/pre.hxx': No such file or directory I searched the xsd folder and cannot find [pre.hxx]. So I copy the folder xsd, which contains cxx/pre.hxx, from libxsd of Ver. 4.0.4. (I know this is not correct, but I did it for Ver. 4.1 ). The errors shows at the following lines at the generated .hxx files: #if (LIBXSD_VERSION != 400001999995030L) #error XSD runtime version mismatch #endif Now I cannot figured out what to do. Miao Boris Kolpackov ? 2021?12?11? ?? ??9:00??? > Miao Wang writes: > > > However, because I never use build2 before, after trying all the day, I > > failed to build the XSD for Windows 10 following the instructions. > > Could you make it for me to test? > > Unfortunately not: we are moving away from manually building binaries > since it's not sustainable. But if you can tell me what exactly didn't > work with the build2 approach, I would be happy to help. > From boris at codesynthesis.com Mon Dec 13 06:10:41 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 13 06:08:15 2021 Subject: [xsd-users] setValidationScheme In-Reply-To: References: Message-ID: Zhang, Yan writes: > Thank you for your quick response, maybe I post my question to a wrong > place? My colleague recommended me to send xml parser related question > here. This mailing list is for questions about using CodeSynthesis XSD[1]. It's not for questions about using Xerces-C++ (that project has its own mailing lists) nor for general XML/XML Schema-related questions. [1] https://codesynthesis.com/products/xsd/ From boris at codesynthesis.com Mon Dec 13 06:28:38 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Dec 13 06:26:11 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Miao Wang writes: > Finally, I success in building XSD after modifying the followings for > [config.build]: > > [...] And disable warning 4819 for encoding problem Could you provide more detail on what was the issue that made you add /wd4819? The text of the actual warning from the compiler would be ideal. > 2. config.install.root=C:/xsd //( not C:\xsd as in the instruction) Hm, again, this works fine for me and for others. What was the issue that made you change this? On a more general note, it's not very helpful so say "something went wrong and I managed to work around it by changing X to Y". Clearly I would like to fix this so that the workaround is not necessary but you are not providing any information on what actually went wrong. > Then the c++ code for CityGML 2.0 was generated using the newly built > Ver. 4.2.0-b.3. When compiling the generated code using MSVC, it shows the > error at the generated .hxx files: > C1083: 'xsd/cxx/pre.hxx': No such file or directory > I searched the xsd folder and cannot find [pre.hxx]. Hm, are they not in C:\xsd\{debug,release}\include\xsd\cxx\ ? Did you perform the steps in 2.3 "Building XSD Runtime Library": https://codesynthesis.com/products/xsd/doc/install-build2.xhtml#windows-libxsd ? > So I copy the folder xsd, which contains cxx/pre.hxx, from libxsd of Ver. > 4.0.4. (I know this is not correct, but I did it for Ver. 4.1 ). No, this is not going to work: you cannot mix generated code and runtime library from different versions. That check and error are there to prevent exactly that. From miaowang.tw at gmail.com Mon Dec 13 21:54:25 2021 From: miaowang.tw at gmail.com (Miao Wang) Date: Tue Dec 14 10:31:13 2021 Subject: [xsd-users] Problem for parsing CityGML using xsd v4.1.0.a11 In-Reply-To: References: Message-ID: Boris Kolpackov ? 2021?12?13? ?? ??7:28??? > Miao Wang writes: > > > Finally, I success in building XSD after modifying the followings for > > [config.build]: > > > > [...] And disable warning 4819 for encoding problem > > Could you provide more detail on what was the issue that made you add > /wd4819? The text of the actual warning from the compiler would be > ideal. > > If warning 4819 is not disabled, the error message is: error C2220: warning treated as error warning C4819: The file contains a character that cannot be represented in the current code page (950) This happens on the following files: C:\xsd-build\libxsd-msvc-release\libicuuc-65.1.0+6\libicu/uc\unicode/stringoptions.h(1) C:\xsd-build\libxsd-msvc-release\libicuuc-65.1.0+6\libicu/uc\unicode/uchar.h(2360) C:\xsd-build\libxsd-msvc-release\libxerces-c-3.2.3+3\xercesc\util\XMLFloat.cpp(1) C:\xsd-build\libxsd-msvc-release\libxerces-c-3.2.3+3\xercesc\validators\schema\TraverseSchema.cpp(7687) I have ever tried to save these files as UTF-16(LE) using Notepad and then C4819 did not happen. But this is not a regular method. > > > 2. config.install.root=C:/xsd //( not C:\xsd as in the instruction) > > Hm, again, this works fine for me and for others. What was the issue > that made you change this? > > On a more general note, it's not very helpful so say "something went > wrong and I managed to work around it by changing X to Y". Clearly I > would like to fix this so that the workaround is not necessary but > you are not providing any information on what actually went wrong. > > This problem did not happen when I redo the whole process but I don't know why. > > > Then the c++ code for CityGML 2.0 was generated using the newly built > > Ver. 4.2.0-b.3. When compiling the generated code using MSVC, it shows > the > > error at the generated .hxx files: > > C1083: 'xsd/cxx/pre.hxx': No such file or directory > > I searched the xsd folder and cannot find [pre.hxx]. > > Hm, are they not in C:\xsd\{debug,release}\include\xsd\cxx\ ? > > > Did you perform the steps in 2.3 "Building XSD Runtime Library": > > > https://codesynthesis.com/products/xsd/doc/install-build2.xhtml#windows-libxsd > > ? > > > > So I copy the folder xsd, which contains cxx/pre.hxx, from libxsd of Ver. > > 4.0.4. (I know this is not correct, but I did it for Ver. 4.1 ). > > No, this is not going to work: you cannot mix generated code and runtime > library from different versions. That check and error are there to prevent > exactly that. > I really missed step 2.3. After redo the whole processes, XSD works. Thank you again. ?????www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> From miaowang.tw at gmail.com Sat Dec 25 09:18:58 2021 From: miaowang.tw at gmail.com (Miao Wang) Date: Tue Dec 28 05:35:11 2021 Subject: [xsd-users] Problem to transform mathml2 for COLLADA to C++ Message-ID: Hello, I follow the thread https://www.codesynthesis.com/pipermail/xsd-users/2009-July/002388.html to transform COLLADA 1.5 and success. Because COLLADA need mathml2 to work, I transform the xsd files in mathml2. When transform common/math.xsd using the same parameters, the following error shows: common/math.xsd:36:47: error: group ' http://www.w3.org/1998/Math/MathML:Presentation-token.class' not found common/math.xsd:37:48: error: group ' http://www.w3.org/1998/Math/MathML:Presentation-layout.class' not found common/math.xsd:38:48: error: group ' http://www.w3.org/1998/Math/MathML:Presentation-script.class' not found common/math.xsd:39:47: error: group ' http://www.w3.org/1998/Math/MathML:Presentation-table.class' not found common/math.xsd:40:31: error: type ' http://www.w3.org/1998/Math/MathML:mspace' not found common/math.xsd:40:31: error: referenced element 'mspace' not found .......more Has anyone successfully to transform mathml2 ? Best regards, Miao