From david.r.moss at selex-comm.com Mon Jun 5 06:59:59 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] xsd:key / xsd:keyref / xsd:unique In-Reply-To: <20060531155333.GA8209@karelia> Message-ID: Boris, Any idea when key / keyref will be supported (apologies if it already is - I must be doing something wrong!)? I can work with ID and IDREF although this appears not to be as flexible (only works with attributes, only global scope, tied-in to the definition of the data-type). Cheers, Dave. Dave Moss SELEX Communications Grange Road Christchurch Dorset BH23 4JE United Kingdom Tel: + 44 (0) 1202 404841 Email: david.r.moss@selex-comm.com From boris at codesynthesis.com Mon Jun 5 07:43:04 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Re: xsd:key / xsd:keyref / xsd:unique In-Reply-To: References: <20060531155333.GA8209@karelia> Message-ID: <20060605114304.GA24361@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > Any idea when key / keyref will be supported (apologies if it already is > - I must be doing something wrong!)? They are supported in validation (in Xerces-C++). There is no mapping to C++ yet, however. At some point in the past I was considering different ways of mapping these constructs to programming languages but could not come up with anything simple enough that I felt comfortable implementing without a use case. We can discuss this further if you need this functionality. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060605/e446bcf1/attachment.pgp From paolo.volpi at gmail.com Thu Jun 8 13:56:59 2006 From: paolo.volpi at gmail.com (Paolo Volpi) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Linux ppc build Message-ID: <5d707b00606081056o12585502l32321c772cd5a9ac@mail.gmail.com> What about supporting Linux/ppc? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060608/d5c8b4f0/attachment.htm From behzad at rocketmail.com Thu Jun 8 12:35:04 2006 From: behzad at rocketmail.com (Behzad) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Solaris Message-ID: <20060608163505.77818.qmail@web51402.mail.yahoo.com> Hi, Has any one tried to build XSD for solaris x86? I am not sure whats needed. I have all GNU tools installed. I have seen the build procesure for windows, is the same procedure apply for Solaris? apriciate any help, Behzad __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boris at codesynthesis.com Thu Jun 8 14:28:18 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Solaris In-Reply-To: <20060608163505.77818.qmail@web51402.mail.yahoo.com> References: <20060608163505.77818.qmail@web51402.mail.yahoo.com> Message-ID: <20060608182818.GA7644@karelia> Hi Behzad, Behzad writes: > Has any one tried to build XSD for solaris x86? I am not sure whats > needed. I have all GNU tools installed. I have seen the build procesure > for windows, is the same procedure apply for Solaris? Yes, except for the following differences: Cygwin This step is not needed. You will need fairly recent (3.4.x or later) g++. STLPort This step is not needed. boost-jam You will probably need to build boost-jam from sources (quite easy). Boost Follow standard build instructions for Boost with gcc toolset: http://www.boost.org/more/getting_started.html Xerces-C++ Follow standard instructions from Xerces-C++. You will need to specify C and C++ compilers to the runConfigure script since by default it will use Sun C/C++, e.g.: ./runConfigure -p solaris -c gcc -x g++ You don't need to do any modifications to any files in Xerces-C++. libcult libfrontend-elements libbackend-elements libxsd-frontend xsd Follow instructions described in the windows build except leave out everything that refers to stlport or cygwin. I can provide you with whatever assistance you need in building it yourself; just send descriptions of any problems to this mailing list. Alternatively I can build you the binary for Solaris 10, x86. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060608/e227eb10/attachment.pgp From boris at codesynthesis.com Thu Jun 8 14:31:10 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Linux ppc build In-Reply-To: <5d707b00606081056o12585502l32321c772cd5a9ac@mail.gmail.com> References: <5d707b00606081056o12585502l32321c772cd5a9ac@mail.gmail.com> Message-ID: <20060608183110.GB7644@karelia> Hi Paolo, Paolo Volpi writes: > What about supporting Linux/ppc? It should work fine on Linux/ppc. Would you like me to build you a binary for that platform? hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060608/4884cb81/attachment.pgp From boris at codesynthesis.com Thu Jun 8 15:47:46 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Re: Xsd information In-Reply-To: <2DE54DAE7663904EBE73640007F9EAC703DAB956@NSTMC101PEX1.ubsw.net> References: <2DE54DAE7663904EBE73640007F9EAC703DAB956@NSTMC101PEX1.ubsw.net> Message-ID: <20060608194746.GC7644@karelia> Hi Anatolii, I've CC'ed xsd-users mailing list. This way others can benefit from the information. Anatolii.Belomestnov@ubs.com writes: > I have a couple of questions about the XSD product: > > * I am trying to use visual studio .net 2003 with a Linux/C++ > project (accessing everything from network drive), most visual studio > intellisense works pretty well except for XSD generated classes. It > would be great if all underlying functors, containers, accessors, etc. > would all show up - would make it much easier to xsd. I think this is > more like essential to have. I just tracked this problem down. Apparently VC++ 2003 Intellisense cannot handle this style of putting const: void f (string const&) The fix is straightforward but extensive; I will try to make it for the next release. > * How hard it would be to make the generated code use some > specific auto pointer, like boost's shared_ptr? Not hard though there is not much gain from doing this, IMO. The only (public) interface that exposes std::auto_ptr are parsing functions. You can always do something like this: auto_ptr ap (foo ("foo.xml")); shared_ptr sp (au.release ()); Also, shared_ptr in the latest boost (1.33.1) has a constructor from std::auto_ptr, so the above becomes: auto_ptr ap (foo ("foo.xml")); shared_ptr sp (au); You cannot write this, however: shared_ptr sp (foo ("foo.xml")); > * I saw the tree mapping manual > (http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#1. > 1.2) but would like to see the complete guide to what kind of accessors > are generated for what types of xsd so that it's more streamlined to > program in it. I believe the C++/Tree manual is quite complete. It describes every XML Schema construct for which there is C++ mapping. Here are the main parts: Section 2.4 - Namespaces Section 2.5 - Built-in types Section 2.6 - Simple types Section 2.7 - Complex types Section 2.8 - Local Elements and Attributes In particular, Section 2.8.1 describes accessors/modifiers for minOccurs=1 maxOccurs=1 Section 2.8.2 describes accessors/modifiers for minOccurs=0 maxOccurs=1 Section 2.8.3 describes accessors/modifiers for maxOccurs=unbounded Section 3 - Mapping for global elements to parsing functions Section 4 - Mapping for global elements to serialization functions Can you point me to the places where you believe the documentation is not complete? You implying that it is not complete really hurts my feelings ;-) hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060608/97d441d0/attachment.pgp From boris at codesynthesis.com Fri Jun 9 13:21:49 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Re: Xsd information In-Reply-To: <2DE54DAE7663904EBE73640007F9EAC703E2B6F6@NSTMC101PEX1.ubsw.net> References: <2DE54DAE7663904EBE73640007F9EAC703E2B6F6@NSTMC101PEX1.ubsw.net> Message-ID: <20060609172149.GA3013@karelia> Hi Anatolii, In the future, please send technical questions regarding XSD usage to the xsd-users mailing list (which I've also CC'ed to this reply) instead of directly to me. Anatolii.Belomestnov@ubs.com writes: > Never mind this one, I was creating an auto_ptr in one of the called > methods which I think was deleting some stuff before its time. Ok, I am glad you found the cause and thanks for letting me know. > See, the boost::shared_ptr would be great to use because you don't need > to do all the accounting of who should own the objects. Auto-ptr still > requires to be watched closely. And I would have more freedom with > boost. As I said in my previous post, nothing prevents you from re-assigning the ownership from auto_ptr to shared_ptr after parsing. That's the only place where will ever need to do it. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060609/d1de9db4/attachment.pgp From david.lascombe at gmail.com Mon Jun 12 10:40:33 2006 From: david.lascombe at gmail.com (David Lscbe) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] request for macosx INTEL binairies Message-ID: Hi, I am running macosx on a macintel macbook pro and I need to use xsd for an application I am developing. Does someone already have managed to build a macos i686 version ? Thanks, David From boris at codesynthesis.com Mon Jun 12 11:19:44 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] request for macosx INTEL binairies In-Reply-To: References: Message-ID: <20060612151944.GA12026@karelia> Hi David, David Lscbe writes: > I am running macosx on a macintel macbook pro and I need to use xsd > for an application I am developing. Does someone already have managed > to build a macos i686 version ? I think you can use the PowerPC binary of the compiler via the emulator (Rosetta). You will need to build Xerces-C++ or Expat for x86, though. The XSD runtime library is header-only so nothing to build there. I don't have access to a x86 Mac. I guess I could try to (cross) compile one on PowerPC. Or even create a fat binary. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060612/a1e683c5/attachment.pgp From david.lascombe at gmail.com Mon Jun 12 11:47:24 2006 From: david.lascombe at gmail.com (David Lscbe) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] request for macosx INTEL binairies In-Reply-To: <20060612151944.GA12026@karelia> References: <20060612151944.GA12026@karelia> Message-ID: <1492C781-FB5E-4B41-92FF-6DA890436D3A@gmail.com> Actually I already compiled Xerces. I had almost no problem to build the unix sources via the macosx command line (only had to remove the 'static' keyword at 2 places in a source file and it was ok). Ok I'll try to run my app with the powerpc binary...i'll get back to you as soon as done. David Le 12 juin 06 ? 17:19, Boris Kolpackov a ?crit : > Hi David, > > David Lscbe writes: > >> I am running macosx on a macintel macbook pro and I need to use xsd >> for an application I am developing. Does someone already have managed >> to build a macos i686 version ? > > I think you can use the PowerPC binary of the compiler via the > emulator (Rosetta). You will need to build Xerces-C++ or Expat > for x86, though. The XSD runtime library is header-only so > nothing to build there. > > I don't have access to a x86 Mac. I guess I could try to (cross) > compile one on PowerPC. Or even create a fat binary. > > > hth, > -boris From david.lascombe at gmail.com Mon Jun 12 13:16:21 2006 From: david.lascombe at gmail.com (David Lscbe) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] request for macosx INTEL binairies In-Reply-To: <1492C781-FB5E-4B41-92FF-6DA890436D3A@gmail.com> References: <20060612151944.GA12026@karelia> <1492C781-FB5E-4B41-92FF-6DA890436D3A@gmail.com> Message-ID: Ok, I downloaded the PowerPC Mac OS binary and it almost worked. The truth is that I try to build my application which is building well under linux. I have modified everything in the Makefile so that this can be done...And everything is building smoothly except for that : "GenerateurScene/schemaInitScene.cpp:2215: error: 'dom' is not a member of 'xsd::cxx::xml::dom' " Do you know if this can be due to the fact that I was using version 2.0 under Linux and that I am using 2.1.1 now? Or have you any ohter idea from where it comes from? Best, David Le 12 juin 06 ? 17:47, David Lscbe a ?crit : > Actually I already compiled Xerces. I had almost no problem to > build the unix sources via the macosx command line (only had to > remove the 'static' keyword at 2 places in a source file and it was > ok). > Ok I'll try to run my app with the powerpc binary...i'll get back > to you as soon as done. > > David > > > > Le 12 juin 06 ? 17:19, Boris Kolpackov a ?crit : > >> Hi David, >> >> David Lscbe writes: >> >>> I am running macosx on a macintel macbook pro and I need to use xsd >>> for an application I am developing. Does someone already have >>> managed >>> to build a macos i686 version ? >> >> I think you can use the PowerPC binary of the compiler via the >> emulator (Rosetta). You will need to build Xerces-C++ or Expat >> for x86, though. The XSD runtime library is header-only so >> nothing to build there. >> >> I don't have access to a x86 Mac. I guess I could try to (cross) >> compile one on PowerPC. Or even create a fat binary. >> >> >> hth, >> -boris > From david.lascombe at gmail.com Mon Jun 12 13:32:05 2006 From: david.lascombe at gmail.com (David Lscbe) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] request for macosx INTEL binairies In-Reply-To: References: <20060612151944.GA12026@karelia> <1492C781-FB5E-4B41-92FF-6DA890436D3A@gmail.com> Message-ID: <4CE31705-89F9-4C16-AC30-0EF893522D55@gmail.com> Ok it BUILDS! Sorry, I should have tried the 2.0. version before the 2.1.1. But maybe someone can help me now. I have this error when I try to exec my app : dyld: Library not loaded: libxerces-c.26.dylib Referenced from: /Users/davidlscbe/Documents/osgViewer/./ testOSGViewer.exe Reason: image not found Trace/BPT trap Does that mean that I missbuilt something or is that something to fix in my Makefile ?? Thanks any help would be greatly appreciated, David Le 12 juin 06 ? 19:16, David Lscbe a ?crit : > Ok, I downloaded the PowerPC Mac OS binary and it almost worked. > The truth is that I try to build my application which is building > well under linux. > I have modified everything in the Makefile so that this can be > done...And everything is building smoothly except for that : > > "GenerateurScene/schemaInitScene.cpp:2215: error: 'dom' is not a > member of 'xsd::cxx::xml::dom' " > > Do you know if this can be due to the fact that I was using version > 2.0 under Linux and that I am using 2.1.1 now? Or have you any > ohter idea from where it comes from? > > > Best, > > David > > > > > > Le 12 juin 06 ? 17:47, David Lscbe a ?crit : > >> Actually I already compiled Xerces. I had almost no problem to >> build the unix sources via the macosx command line (only had to >> remove the 'static' keyword at 2 places in a source file and it >> was ok). >> Ok I'll try to run my app with the powerpc binary...i'll get back >> to you as soon as done. >> >> David >> >> >> >> Le 12 juin 06 ? 17:19, Boris Kolpackov a ?crit : >> >>> Hi David, >>> >>> David Lscbe writes: >>> >>>> I am running macosx on a macintel macbook pro and I need to use xsd >>>> for an application I am developing. Does someone already have >>>> managed >>>> to build a macos i686 version ? >>> >>> I think you can use the PowerPC binary of the compiler via the >>> emulator (Rosetta). You will need to build Xerces-C++ or Expat >>> for x86, though. The XSD runtime library is header-only so >>> nothing to build there. >>> >>> I don't have access to a x86 Mac. I guess I could try to (cross) >>> compile one on PowerPC. Or even create a fat binary. >>> >>> >>> hth, >>> -boris >> > From boris at codesynthesis.com Mon Jun 12 14:00:23 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] request for macosx INTEL binairies In-Reply-To: <4CE31705-89F9-4C16-AC30-0EF893522D55@gmail.com> References: <20060612151944.GA12026@karelia> <1492C781-FB5E-4B41-92FF-6DA890436D3A@gmail.com> <4CE31705-89F9-4C16-AC30-0EF893522D55@gmail.com> Message-ID: <20060612180023.GA12324@karelia> Hi David, David Lscbe writes: > Ok it BUILDS! > Sorry, I should have tried the 2.0. version before the 2.1.1. Cool. You were probably using code generated with 2.0.x and the runtime from 2.1.1. > But maybe someone can help me now. I have this error when I try to > exec my app : > > dyld: Library not loaded: libxerces-c.26.dylib You need to set DYLD_LIBRARY_PATH environment variable to include the directory where libxerces-c.26.dylib is, e.g., $ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/path/to/xerces-x.y.z/lib Alternatively, you can copy libxerces-c.26.dylib to one of the directories where the dynamic linker looks by default, usually /usr/lib and /usr/local/lib. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060612/c1598c9f/attachment.pgp From andy.ward at hevday.com Mon Jun 12 20:38:53 2006 From: andy.ward at hevday.com (Andrew Ward) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Delay loading Message-ID: <448E091D.9070000@hevday.com> Could anyone suggest any strategies to allow the creation of a C++/Tree XSD DOM but have the parsing be done on demand, when the actual elements are accessed? I am working with large XML documents that can take more than 10 seconds to load into the DOM but before any user action I typically only access a couple of top level attributes. Andrew Ward. From Nicholas_Grimes at raytheon.com Tue Jun 13 11:13:43 2006 From: Nicholas_Grimes at raytheon.com (Nicholas Grimes) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] examples\cxx\tree\library Message-ID: Hi, I have built the XSD demo projects, specifically the aformentioned example, and have a question. The driver.cxx constructs a "book b" that it inserted and serialized out to the xml file. Question is that when I look at the library.xml I do not see the inserted book. Am I missing something here ? Regards, Nick Boris, I work with the Vandy guys and was using XSC but found XSD which is a mastly superior product. From pkrishnamoorthy at fadv.com Tue Jun 13 12:29:07 2006 From: pkrishnamoorthy at fadv.com (Krishnamoorthy, Prabhakaran) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] C++/Tree: In-Memory XML Data Binding Message-ID: <9607BDAE4B2AF74DA8E55BF32514FA9A22B6C89E@credpwy01sxch01.credit.credco.net> Hello codesynthesis, I need XML binding software for AIX 5.2 and VA 6.0 platform. Please let me know if you support that platform. Also, I am OK to generate code in Windows and compile it in AIX system. Is the generated code platform independent? Thanks, Pk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060613/ce32fefc/attachment.html From boris at codesynthesis.com Tue Jun 13 14:40:32 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] examples\cxx\tree\library In-Reply-To: References: Message-ID: <20060613184032.GA15925@karelia> Hi Nicholas, Nicholas Grimes writes: > I have built the XSD demo projects, specifically the aformentioned example, > and have a question. The driver.cxx constructs a "book b" that it inserted > and serialized out to the xml file. Question is that when I look at the > library.xml I do not see the inserted book. Am I missing something here ? The example does not serialize to library.xml, instead it just dumps the XML to STDOUT (std::cout): // Write it out. // catalog (std::cout, *l, map); If you want it in a file, you can change the line about to something like this: std::ofstream ofs ("out.xml"); catalog (ofs, *l, map); > Boris, I work with the Vandy guys and was using XSC but found XSD which is > a mastly superior product. Thanks. This is the "take two", so to speak ;-). BTW, do you know Ricky H Linh ? He is also from Raytheon and seems to be using XSD. There are a couple of emails in the archives from him. -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060613/f2b634d2/attachment.pgp From boris at codesynthesis.com Tue Jun 13 14:50:33 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] C++/Tree: In-Memory XML Data Binding In-Reply-To: <9607BDAE4B2AF74DA8E55BF32514FA9A22B6C89E@credpwy01sxch01.credit.credco.net> References: <9607BDAE4B2AF74DA8E55BF32514FA9A22B6C89E@credpwy01sxch01.credit.credco.net> Message-ID: <20060613185033.GB15925@karelia> Hi Prabhakaran, Krishnamoorthy, Prabhakaran writes: > I need XML binding software for AIX 5.2 and VA 6.0 platform. Please let me > know if you support that platform. We don't officially support AIX 5.1 yet because we haven't had any commercial interest in this platform. > Also, I am OK to generate code in Windows and compile it in AIX system. Is > the generated code platform independent? Yes it is. It should work with any fairly standard-compliant C++ compiler. I suggest you generate the code for one of the examples on Windows and try to compile it on AIX with VA 6.0. If there are any compile errors please let us know (by posting to this mailing list); we might be able to address them. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060613/80232b5f/attachment.pgp From boris at codesynthesis.com Tue Jun 13 15:25:18 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Delay loading In-Reply-To: <448E091D.9070000@hevday.com> References: <448E091D.9070000@hevday.com> Message-ID: <20060613192518.GC15925@karelia> Hi Andrew, Andrew Ward writes: > Could anyone suggest any strategies to allow the creation of a C++/Tree > XSD DOM but have the parsing be done on demand, when the actual elements > are accessed? > I am working with large XML documents that can take more than 10 seconds > to load into the DOM but before any user action I typically only access > a couple of top level attributes. Hm, there is no such thing in Xerces-C++ DOM parser. Some tricks could be possible when parsing DOM to the C++/Tree representation, however. It is therefore important to figure out first where the majority of time is being spent. There are three main things happen when one parses XML to the C++/Tree representation: XML Schema validation, XML to DOM parsing, and DOM to the C++/Tree representation parsing. A quick way to measure the time it takes to parse XML to DOM is by calling one of the internal parsing functions in the XSD runtime: #include #include xercesc::XMLPlatformUtils::Initialize (); { xsd::cxx::xml::properties prop; xsd::cxx::tree::error_handler eh; xsd::cxx::xml::dom::parse ("test.xml", eh, prop, false); // Measure this. } xercesc::XMLPlatformUtils::Terminate (); This parses test.xml to DOM without the XML Schema validation (last argument to parse() is false). You can also measure how much it takes with the validation. If most of your time is spent in XML to DOM parsing (without the validation), then I don't think there is much that can be done about it except perhaps using a faster parser (like libxml2). If most of the time is spent in the validation, then you have a number of options: 1. Disable the XML Schema validation altogether. This option is viable if you are sure your XML documents are valid (because they were created by your application, for instance). Note that the generated code also includes a number of checks that will prevent creation of inconsistent representations (e.g., missing required elements/attributes, etc.). 2. Pre-loading/Caching/Pre-parsing XML Schema grammar. This is described in details in this article: http://www-128.ibm.com/developerworks/webservices/library/x-xsdxerc.html Finally, if you find that the most time is spent in the DOM to the C++/Tree representation phase, then I will be very surprised ;-). Let me know if that's the case and I will come up with something. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060613/16cb7e3d/attachment.pgp From andy.ward at hevday.com Wed Jun 21 22:43:44 2006 From: andy.ward at hevday.com (Andrew Ward) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] ICE Message-ID: <449A03E0.6070604@hevday.com> Hi Boris, Thanks for the tips covered in the "Delay Loading" email. I have come to a satisfactory solution. I have come across a VC 7.1 internal compiler error while making a call into some XSD generated code. Although I am sure the XSD code is fine, I thought I would bring it to your attention in case you want to generate code that avoids the situation. fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 2701) The code that causes the Microsoft bug is along the lines of this: template struct A : public Base::MngCursor { typedef typename Base::MngCursor Inherited; }; template struct B : public Base::MngCursor { typedef typename Base::MngCursor Inherited; }; template struct C { typedef B MngCursor; friend struct B ; }; class D {}; struct E { typedef D MngCursor; }; A > k; And is described here: http://support.microsoft.com/default.aspx?scid=kb%3Ben-gb%3B824389 I am getting the ICE when making a call like this: int s; s = x.A().get().B().get(); x is a const reference to a generated type A is an optional<> B is an optional<> with a base type of int Andy. From boris at codesynthesis.com Thu Jun 22 11:13:57 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] ICE In-Reply-To: <449A03E0.6070604@hevday.com> References: <449A03E0.6070604@hevday.com> Message-ID: <20060622151357.GA32181@karelia> Hi Andrew, Andrew Ward writes: > I have come across a VC 7.1 internal compiler error while making a call > into some XSD generated code. Although I am sure the XSD code is fine, I > thought I would bring it to your attention in case you want to generate > code that avoids the situation. Yes, definitely. Thanks for letting me know! > template > struct A : public Base::MngCursor { > typedef typename Base::MngCursor Inherited; > }; > > template > struct B : public Base::MngCursor { > typedef typename Base::MngCursor Inherited; > }; > > template > struct C { > typedef B MngCursor; > friend struct B ; > }; > > class D {}; > > struct E { > typedef D MngCursor; > }; > > A > k; Hm, I can't think of any places where we have such a convoluted structure. > I am getting the ICE when making a call like this: > int s; > s = x.A().get().B().get(); > > x is a const reference to a generated type > A is an optional<> > B is an optional<> with a base type of int I tried to reproduce this problem using the following test case: #include "test.hxx" void f (C const& x) { int i; i = x.a ().get ().i ().get (); } It does not result in the ICE you observe (xsd-2.1.1, cl.exe 13.10.3077). Would it be possible for you to provide a small test case that reproduces the problem? thanks, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060622/1422a6f1/attachment.pgp From andy.ward at hevday.com Thu Jun 22 16:55:07 2006 From: andy.ward at hevday.com (Andrew Ward) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] ICE In-Reply-To: <20060622151357.GA32181@karelia> References: <449A03E0.6070604@hevday.com> <20060622151357.GA32181@karelia> Message-ID: <449B03AB.4090205@hevday.com> Boris Kolpackov wrote: > >Would it be possible for you to provide a small test case that reproduces >the problem? > >thanks, >-boris > Hi Boris, Here is a test case as requested: The XSD file s.xsd: The main.cpp file: #include "s.hxx" int main() { int i; const AppleType * first; i = first->Core().get().Pip().get(); } The command: xsd cxx-tree s.xsd Using XSD.exe 2.1.1 and cl.exe 13.10.3077 this produces the ICE. Regards, Andrew Ward. From ext.zxmularta001 at astrium.eads.net Fri Jun 23 11:38:28 2006 From: ext.zxmularta001 at astrium.eads.net (ZXMULARTA001, Ext) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] mapping in shared memory Message-ID: <17F5FEED8AA6D41185B100508BAF1B0613107B61@meteor.tls.fr.astrium.corp> Hello, I would like to define my data with XML and put the generated xsd-tree object into a shared memory. In order to do that, I'd like to generate only C structure (and not the complex C++ object) Is there a solution to do that with xsd ? Or how can I mount a xsd-tree object into a shared memory ? Thank you. --------------------------------------------------------- CE COURRIER ELECTRONIQUE EST A USAGE STRICTEMENT INFORMATIF ET NE SAURAIT ENGAGER DE QUELQUE MANIERE QUE CE SOIT EADS ASTRIUM SAS, NI SES FILIALES. SI UNE ERREUR DE TRANSMISSION OU UNE ADRESSE ERRONEE A MAL DIRIGE CE COURRIER, MERCI D'EN INFORMER L'EXPEDITEUR EN LUI FAISANT UNE REPONSE PAR COURRIER ELECTRONIQUE DES RECEPTION. SI VOUS N'ETES PAS LE DESTINATAIRE DE CE COURRIER, VOUS NE DEVEZ PAS L'UTILISER, LE CONSERVER, EN FAIRE ETAT, LE DISTRIBUER, LE COPIER, L'IMPRIMER OU EN REVELER LE CONTENU A UNE TIERCE PARTIE. This email is for information only and will not bind EADS Astrium SAS in any contract or obligation, nor its subsidiaries. If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it. --------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060623/ad1c85bc/attachment.htm From boris at codesynthesis.com Sun Jun 25 06:50:55 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] ICE In-Reply-To: <449B03AB.4090205@hevday.com> References: <449A03E0.6070604@hevday.com> <20060622151357.GA32181@karelia> <449B03AB.4090205@hevday.com> Message-ID: <20060625105055.GA7085@karelia> Hi Andrew, Andrew Ward writes: > Here is a test case as requested: Thanks for the test. I managed to strip it down to the following code fragment: template struct Base { template operator Y () const { return x_; } private: X x_; }; struct Derived: Base { }; void f (Type const& p) { int i = p; } Interestingly, it doesn't have much in common with the code in the MSDN article. The only fix I could find is to disabled this operator for VC 7.1 (VC 8 has this bug fixed). This will prevent some non- trivial conversion cases from compilng with this compiler. Your case will work, however. The fix will appear in the next release. Let me know if you would a patch for 2.1.1. Thanks again for reporting this. -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060625/2276e9b3/attachment.pgp From boris at codesynthesis.com Sun Jun 25 07:19:38 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] mapping in shared memory In-Reply-To: <17F5FEED8AA6D41185B100508BAF1B0613107B61@meteor.tls.fr.astrium.corp> References: <17F5FEED8AA6D41185B100508BAF1B0613107B61@meteor.tls.fr.astrium.corp> Message-ID: <20060625111938.GB7085@karelia> Hi, ZXMULARTA001, Ext writes: > I would like to define my data with XML and put the generated xsd-tree > object into a shared memory. In order to do that, I'd like to generate > only C structure (and not the complex C++ object) Is there a solution > to do that with xsd ? No, XSD does not (yet) have a backend that generates C mapping. Note, however, that this will make little difference in your case since the generated structs will have dynamically-allocated, non-trivial data as their members (e.g, strings, arrays of nested structs, etc.) which will make you solve pretty much the same problems as in the case of C++ mapping (see below). > Or how can I mount a xsd-tree object into a shared memory ? There are two things that prevent the current implementation of C++/Tree mapping from being shared-memory friendly, so to speak. The first is the use of virtual functions. Luckily, their use is limited to construction and destruction of the tree. If after the "master" process constructs the tree in a shared memory region other processes are only going to do read-only access, the virtual functions will not pose any problems. If you need read/write access from several processes then things are a bit more tricky. Let me know if that's the case and you are interested in a solution. The second, bigger, problem is to actually place the tree and all its components (e.g., strings, sequences, etc.) in a shared memory region. This is usually achieved with custom allocators which are not (yet) supported in the C++/Tree mapping. To summarize, the C++/Tree mapping is not (yet) ready for the shared memory use. It is, however, not too hard to make it usable in this context. We could probably customize the C++/Tree for you (or implement the C mapping above) on a commercial basis. Let me know if you are interested. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060625/3ce05b6f/attachment.pgp From Rajguru_Rajendrakumar at emc.com Mon Jun 26 15:57:31 2006 From: Rajguru_Rajendrakumar at emc.com (Rajguru_Rajendrakumar@emc.com) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] "Error : is not a valid filesystem path" Message-ID: <8AD77DF99E2EDB4A905631E7317CB8D4017F4EDE@CORPUSMX40B.corp.emc.com> Hello All, I am new to XSD. After trying out sample programs given with XSD distribution , when I try my schema to compile , I am getting following error.. bash-3.00$ xsd cxx-tree --output-dir ../Generated_Code/ --generate-polymorphic MySchema.xsd List.xsd: error: 'MYSchema.xsd ' is not a valid filesystem path where MySchema.xsd have following following line, along with other includes I am not able to understand meaning of error, "List.xsd: error: 'MYSchema.xsd ' is not a valid filesystem path" Any inputs from anybody are welcome ! Thanks in advance ! Regards, Kumar. From boris at codesynthesis.com Tue Jun 27 02:35:49 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] "Error : is not a valid filesystem path" In-Reply-To: <8AD77DF99E2EDB4A905631E7317CB8D4017F4EDE@CORPUSMX40B.corp.emc.com> References: <8AD77DF99E2EDB4A905631E7317CB8D4017F4EDE@CORPUSMX40B.corp.emc.com> Message-ID: <20060627063549.GA12719@karelia> Hi, Rajguru_Rajendrakumar@emc.com writes: > bash-3.00$ xsd cxx-tree --output-dir ../Generated_Code/ > --generate-polymorphic MySchema.xsd > List.xsd: error: 'MYSchema.xsd ' is not a valid filesystem path Note the extraneous space at the end of 'MYSchema.xsd '. You are most likely have something like this in your schema: Try removing the space at the end so that it reads: hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060627/c8cbd6f3/attachment.pgp From mwburn at mhpcc.hpc.mil Tue Jun 27 17:47:06 2006 From: mwburn at mhpcc.hpc.mil (Matt Burnham) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] CoT schema and xsd In-Reply-To: <200606271600.k5RG0bjx019807@codesynthesis.com> References: <200606271600.k5RG0bjx019807@codesynthesis.com> Message-ID: <44A1A75A.5060900@mhpcc.hpc.mil> We are using xsd (version 1.9.0 on Windows/Linux) for several different schemas and I'm now trying to create a cxx-tree for a new schema. The schema(s) are called Cursor on Target (maintained by Mitre) so I don't own it, and can't change it (if interested you can request access at http://cot.mitre.org/). First off, has anyone else used xsd to create a cxx-tree for these schemas? If so how did they resolve the issues i'm having? I get the following warnings: event.xsd:568:19: warning: '(anonymous type for (anonymous type for event)/point)' is used to classify 2 attributes/elements: event.xsd:567:27: warning: 'point', which is defined here event.xsd:35:30: warning: 'point', which is defined here event.xsd:568:19: warning: this may result in excessive code duplication event.xsd:568:19: info: consider explicitly naming this type event.xsd:568:19: info: or use --morph-anonymous option It still generates code, but produces error when compiling, so I use the --morph-anonymous option it gets rid of the warnings, but my resulting code still get the following compiler errors: event.hxx(706) : error C2039: 'type_' : is not a member of 'xsd::cxx::tree::type' D:\tools\xsd-1.9.0-i686-windows\libxsd\xsd\cxx\tree\elements.hxx(110) : see declaration of 'xsd::cxx::tree::type' event.hxx(706) : error C2143: syntax error : missing ';' before 'const' event.hxx(706) : error C2501: 'event::_xsd_event_::event::type_' : missing storage-class or type specifiers event.hxx(709) : error C2039: 'type_' : is not a member of 'xsd::cxx::tree::type' I believe it has something to do the schema containing the following "type" attribute: From mwburn at mhpcc.hpc.mil Tue Jun 27 23:17:20 2006 From: mwburn at mhpcc.hpc.mil (Matt Burnham) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] CoT schema and xsd followup Message-ID: <44A1F4C0.5050702@mhpcc.hpc.mil> I've updated my version of xsd to the latest and using some of the added options, things are now working. My next question is: I have a "core" schema that has a placeholder element called "detail". I then have multiple sub-schemas for data that can go inside of the "detail" section. My actual xml file that I'm parsing get's loaded into the cxx-tree, but I can only access the "detail" element. Is there any way to get to the "embedded data? And then pass this data to the parsers I have for it? I've attached a simplified version of the core schema. And here's a simplyfied version of the source: Thanks, Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: tmp.xsd Type: text/xml Size: 529 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060627/aeacf52b/tmp.bin From raulh39 at tid.es Wed Jun 28 06:16:23 2006 From: raulh39 at tid.es (Raul Huertas) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Serialization of ISO-8859-1 caracters. Message-ID: <44A256F7.60802@tid.es> An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/fff950d7/attachment.html From boris at codesynthesis.com Wed Jun 28 07:10:43 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Serialization of ISO-8859-1 caracters. In-Reply-To: <44A256F7.60802@tid.es> References: <44A256F7.60802@tid.es> Message-ID: <20060628111043.GA17800@karelia> Hi Raul, Raul Huertas writes: > The strange thing is that when I use "unaPeticion->login()" the correct > content is displayed, but when I serialize the complete class, it keeps > showing empty. I tried you example on my Debian box with both Xerces-C++ 2.6.0 and 2.7.0 and in both cases it works as expected. I have a couple of suggestions/ questions for you: 1. Does everything work as expected if you use only ASCII characters? 2. Try to set the locale in your application explicitly. I.e., add the following to your simple test: #include int main (int argc, char* argv[]) { setlocale (LC_CTYPE, "ISO-8859-1"); ... } 3. What happens if you try to serialize using UTF-8 instead of ISO-8859-1? Let us know how it goes. -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/7e97886c/attachment.pgp From raulh39 at tid.es Wed Jun 28 07:54:29 2006 From: raulh39 at tid.es (Raul Huertas) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Serialization of ISO-8859-1 caracters. In-Reply-To: <20060628111043.GA17800@karelia> References: <44A256F7.60802@tid.es> <20060628111043.GA17800@karelia> Message-ID: <44A26DF5.7090507@tid.es> Boris Kolpackov escribi?: > ... > I have a couple of suggestions/questions for you: > > > 1. Does everything work as expected if you use only ASCII characters? > Yes. In the test, the only fields that doesn't work was those that I tried to put "special" chars in them. > 2. Try to set the locale in your application explicitly. I.e., add > the following to your simple test: > > #include > > int > main (int argc, char* argv[]) > { > setlocale (LC_CTYPE, "ISO-8859-1"); > > ... > } > > It worked! Thanks a lot. I guess that xerces uses the ctype (isxdigit, toascii, ...) and/or multibyte (mbrtowc, mbsrtowcs, ...) functions, ?doesn't it? > 3. What happens if you try to serialize using UTF-8 instead of ISO-8859-1? > > Same thing: if I call setlocale it works, if I don't, it doesn't. > Let us know how it goes. > > Let me say again ;): thanks. I really want to convince my company to use this library. May be now I can... > -boris > Ra?l. From boris at codesynthesis.com Wed Jun 28 08:30:09 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Serialization of ISO-8859-1 caracters. In-Reply-To: <44A26DF5.7090507@tid.es> References: <44A256F7.60802@tid.es> <20060628111043.GA17800@karelia> <44A26DF5.7090507@tid.es> Message-ID: <20060628123009.GA18640@karelia> Hi Raul, Raul Huertas writes: > I guess that xerces uses the ctype (isxdigit, toascii, ...) and/or > multibyte (mbrtowc, mbsrtowcs, ...) functions, ?doesn't it? Yes, if it was configured to use native character transcoding. > Let me say again ;): thanks. I really want to convince my company to use > this library. May be now I can... You are welcome and good luck! -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/f35433eb/attachment.pgp From boris at codesynthesis.com Wed Jun 28 11:53:30 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] CoT schema and xsd followup In-Reply-To: <44A1F4C0.5050702@mhpcc.hpc.mil> References: <44A1F4C0.5050702@mhpcc.hpc.mil> Message-ID: <20060628155330.GA19911@karelia> Hi Matt, Matt Burnham writes: > I've updated my version of xsd to the latest and using some of the added > options, things are now working. I am glad it is working for you. > I have a "core" schema that has a placeholder element called "detail". > I then have multiple sub-schemas for data that can go inside of the > "detail" section. My actual xml file that I'm parsing get's loaded into > the cxx-tree, but I can only access the "detail" element. Is there any > way to get to the "embedded data? And then pass this data to the > parsers I have for it? > > [...] > > > > > > > > You can do this but it will require a bit of work. The basic idea is as follows: (1) Parse your top-level XML with the keep_dom option (see the mixed example in examples/cxx/tree). (2) Obtain DOMElement corresponding to embedded-data node: using namespace xercesc; detail& d = ... DOMElement* de (static_cast (d._node ())); DOMNodeList* nl (de->getElementsByTagName ("embedded-data"); DOMElement* ede (nl->item (0)); (3) Construct the type corresponding to 'embedded-data' using DOMElement: embedded_data ed (ede); There is, however, a better, more elegant way of doing this if you can change your schemas. The idea is to use XML Schema polymorphism to define open-ended content. Your 'detail' element can be defined as follows: anyType is an XML Schema built-in type that matches any content. Now you can use XML Schema substitution groups to define concrete instances of 'content': ... Your instance still looks exactly the same. But the generated code handles instantiation of 'embedded_data' automatically: detail& d = ... xml_schema::type& c (d.content ()); // xs:anyType maps to xml_schema::type if (embedded_data* ed = dynamic_cast (&c)) { // content is embedded_data } Individual schemas that define various extension data (like 'embedded_data') can be developed separately from the root schema which defines the 'content' element (they will need to include the root schema and be linked into the application, though). There is an example called polymorphism in examples/cxx/tree that shows how this works. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/6645a021/attachment.pgp From kevin at wooten.com Wed Jun 28 13:33:25 2006 From: kevin at wooten.com (Kevin Wooten) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] COLLADA and URIFragmentType Message-ID: <44A2BD65.50408@wooten.com> COLLADA defines the URIFragmentType, which is allowed to be only the fragment portion of a URI, ensuring that the reference is within the current document. What is the best way to resolve this fragment if I have created an xsd tree mapping? Secondly, is there a way to define a custom type in the xsd mapping to handle specific types users encounter. As an example, I would like to have xsd map URIFragmentType to my own C++ class where I could add a "resolve" function to handle my node resolution (reference to above question). Is this possible? Thanks! From gerald.giraud at artal.fr Wed Jun 28 16:01:09 2006 From: gerald.giraud at artal.fr (=?iso-8859-1?Q?G=E9rald_GIRAUD?=) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Performance issues with XSD Message-ID: <1085.82.250.52.237.1151524869.squirrel@webmail.nfrance.com> Hello, We have made some performance tests with XSD and got some surprising results. Our test program performs the following actions: We measure the cpu time consumed to read a xml file into a C++ object and serialize it into another external file (and this 10000 or 100000 times) In our sample, we only change the "book maxOccurs" from the .xsd file. When the maxOccurs=5, the measured time is 5 seconds. When the maxOccurs=500, the mesaured time is 141 seconds, and this with the same data (library_3.xml that contains only 3 books declared) ! Is there a way to fix this problem. Maybe our code is not correct : is it possible to ensure the performance of XSD in that sample (even for maxOccurs=5) ? I join the sources of our sample (driver.cxx, library.xsd and library.xml) Thanks G?rald -------------- next part -------------- A non-text attachment was scrubbed... Name: library.xsd Type: application/octet-stream Size: 1770 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/64113a4a/library.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: library_3.xml Type: text/xml Size: 1412 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/64113a4a/library_3.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: driver.cxx Type: application/octet-stream Size: 1396 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/64113a4a/driver.obj From mwburn at mhpcc.hpc.mil Wed Jun 28 15:49:28 2006 From: mwburn at mhpcc.hpc.mil (Matt Burnham) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] CoT schema and xsd followup In-Reply-To: <20060628155330.GA19911@karelia> References: <44A1F4C0.5050702@mhpcc.hpc.mil> <20060628155330.GA19911@karelia> Message-ID: <44A2DD48.8050504@mhpcc.hpc.mil> An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/d1039797/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: test_event.xml Type: text/xml Size: 179 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/d1039797/test_event.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: tmp_embedded.xsd Type: text/xml Size: 547 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/d1039797/tmp_embedded.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: tmp_event.xsd Type: text/xml Size: 901 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060628/d1039797/tmp_event.bin From raulh39 at tid.es Thu Jun 29 02:32:05 2006 From: raulh39 at tid.es (Raul Huertas) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Performance issues with XSD In-Reply-To: <1085.82.250.52.237.1151524869.squirrel@webmail.nfrance.com> References: <1085.82.250.52.237.1151524869.squirrel@webmail.nfrance.com> Message-ID: <44A373E5.50000@tid.es> An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060629/02498374/attachment.htm From boris at codesynthesis.com Thu Jun 29 05:08:34 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] Performance issues with XSD In-Reply-To: <1085.82.250.52.237.1151524869.squirrel@webmail.nfrance.com> References: <1085.82.250.52.237.1151524869.squirrel@webmail.nfrance.com> Message-ID: <20060629090834.GA22290@karelia> Hi G?rald, G?rald GIRAUD writes: > We have made some performance tests with XSD and got some surprising results. > Our test program performs the following actions: > We measure the cpu time consumed to read a xml file into a C++ object and > serialize it into another external file (and this 10000 or 100000 times) > > In our sample, we only change the "book maxOccurs" from the .xsd file. > > > When the maxOccurs=5, the measured time is 5 seconds. > When the maxOccurs=500, the mesaured time is 141 seconds, and this with > the same data (library_3.xml that contains only 3 books declared) ! > Is there a way to fix this problem. Maybe our code is not correct : is it > possible to ensure the performance of XSD in that sample (even for > maxOccurs=5) ? I think Raul is right; this is a Xerces-C++ schema processor limitation. I ran your test for the following cases: maxOccurs=5 - 2 sec maxOccurs=500 - 79 sec maxOccurs=unbounded - 2 sec You may also want to disable Xerces-C++ validation altogether by passing the dont_validate flag: std::auto_ptr l (catalog (argv[1], xml_schema::flags::dont_validate)); This makes sense if you are sure the XML instances are valid, for example, because they were produced by the same application. With validation disabled, I get 1 sec on your test. If you need XML Schema validation and is parsing multiple files, there is a number of ways to optimize this process as described in the following article: "Cache and serialize XML Schemas with Xerces-C++" http://www-128.ibm.com/developerworks/webservices/library/x-xsdxerc.html > I join the sources of our sample (driver.cxx, library.xsd and library.xml) Thanks, that was very helpful. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060629/fb018b1a/attachment.pgp From boris at codesynthesis.com Thu Jun 29 05:22:07 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] CoT schema and xsd followup In-Reply-To: <44A2DD48.8050504@mhpcc.hpc.mil> References: <44A1F4C0.5050702@mhpcc.hpc.mil> <20060628155330.GA19911@karelia> <44A2DD48.8050504@mhpcc.hpc.mil> Message-ID: <20060629092207.GB22290@karelia> Matt Burnham writes: > Boris, > > Since I don't own the schema's, I'm trying to use the "keep_dom" option. > The problem is I can't get the initial DOMElement from my detail using > d._node() since my detail object is a container. I admit, I don't really > understand the "containers" so I'm probably missing something. Since your 'detail' element is optional (minOccurs="0") it may not be present. So when you call the detail() accessor, you get a container which you can query for presence and also get the value if it is present. This is described in detail here: http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.8.2 > I'm attaching more complete versions of the core schema (event) and the > sub-schema (embedded), along with an example xml file. Thanks, that was helpful. > And here is my code: > > std::string fname = "test_event.xml" > std::auto_ptr obj( > event(fname,xml_schema::flags::dont_validate|xml_schema::flags::keep_dom) > ); > if( obj->type() == "embedded" ) > { If you are sure the detail is present (for example because the type attribute says so), then you can change it to this: > event::detail::container dtl = obj->detail(); to detail& dtl = obj->detail ().get (); > // get the "embedded" data > xercesc::DOMElement* de( > static_cast(dtl._node()) ); > xercesc::DOMNodeList* nl( > de->getElementsByTagName("embedded_data") ); > xercesc::DOMElement* ede( nl->item(0) ); > embedded_data e_data( ede ); > // access the "embedded" data > e_data.attr1(); > e_data.attr2(); > } The rest looks good. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060629/8b68e9c7/attachment.pgp From boris at codesynthesis.com Thu Jun 29 05:28:34 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] CoT schema and xsd followup In-Reply-To: <44A2E78D.5050607@mhpcc.hpc.mil> References: <44A1F4C0.5050702@mhpcc.hpc.mil> <20060628155330.GA19911@karelia> <44A2E78D.5050607@mhpcc.hpc.mil> Message-ID: <20060629092834.GC22290@karelia> Hi Matt, Please send technical questions like this to the xsd-users mailing list instead of directly to me. This way others can benefit from the information. Matt Burnham writes: > Quick question, if I do want to make the schema changes, does the > following code get added to the "core" schema? Inside an element? > Or does it get added to each sub-schema? Inside an element? > > > > > > ... > > > > It is added to the embedded_data sub-schema (along with the embedded-data element). Core schema only defines the substitution group root: hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060629/3a7447f6/attachment.pgp From boris at codesynthesis.com Thu Jun 29 05:58:36 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] COLLADA and URIFragmentType In-Reply-To: <44A2BD65.50408@wooten.com> References: <44A2BD65.50408@wooten.com> Message-ID: <20060629095836.GD22290@karelia> Hi Kevin, Kevin Wooten writes: > COLLADA defines the URIFragmentType, which is allowed to be only the > fragment portion of a URI, ensuring that the reference is within the > current document. What is the best way to resolve this fragment if I > have created an xsd tree mapping? Since it is an application-specific semantics implemented outside of XML Schema mechanisms (e.g., ID/IDREF, etc), there is no out of the box solution for this. It is not even clear to what URIFragmentType refers to (i.e., is it something similar to (X)HTML anchor elements?). The only way that I can think of to generically navigate such a structure in C++/Tree mapping is to scan underlying DOM nodes (e.g., for all anchor elements) and use "back-pointers" to C++/Tree nodes to build a map of URIFragment's to C++/Tree nodes. Then your application can use this map. > Secondly, is there a way to define a custom type in the xsd mapping to > handle specific types users encounter. As an example, I would like to > have xsd map URIFragmentType to my own C++ class where I could add a > "resolve" function to handle my node resolution (reference to above > question). Is this possible? No, it is not yet possible but we are working on this. The idea is to provide an option which will trigger generation of C++ class templates instead of concrete classes for types defined in XML Schema. We believe this is better than just allowing custom types for the following reason. In your example, you don't really want to provide your own URIFragmentType (along with parsing/serialization code, etc). What you would rather do is take the generated URIFragmentType and inherit your own type from it (so that you don't have to worry about parsing/serialization, etc), add whatever extra functionality you want (like resolve function) and use the resulting type instead of the generated URIFragmentType. There is a drawback to this approach, however. Since we now generate class template instead of concrete classes, one will need to provide a suitable typedef for every type defined in XML Schema. This can be quite a lot of types for schemas like COLLADA. We can probably generate an initial list of typedef to facilitate this process. What do you think? hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060629/bf17a630/attachment.pgp From mwburn at mhpcc.hpc.mil Thu Jun 29 19:01:41 2006 From: mwburn at mhpcc.hpc.mil (Matt Burnham) Date: Sun Oct 11 15:33:46 2009 Subject: [xsd-users] RE: Accessing embedded sub-schemas In-Reply-To: <44A43FB2.802@mhpcc.hpc.mil> References: <44A1F4C0.5050702@mhpcc.hpc.mil> <20060628155330.GA19911@karelia> <44A2DD48.8050504@mhpcc.hpc.mil> <20060629092207.GB22290@karelia> <44A43FB2.802@mhpcc.hpc.mil> Message-ID: <44A45BD5.3020607@mhpcc.hpc.mil> Boris, I've made some progress in accessing my embedded sub-schema. From my previous email the issue with, "Trying to access a container directly won't compile", works if I do this. event::detail::type& dtl = obj->detail().get(); instead of event::detail& dtl = obj->detail().get(); When I make this change in the keep-dom approach, I can now create a valid DOMElement, and the exception (since the DOMElement created was NULL) goes away. I'm now down to actually "parsing" the embedded schema using the following code: class embedded edata( ede ); This doesn't work, and the only "Dom" constructor I find for the embedded class takes a DOMDocument. I've gone through the xerces API docs and can't find any way to create a DOMDocument from the DOMElement, or to simply create a string/stream,etc from the DOMElement). Also, in the substitution group approach, I can also access the detail container directly, but still can't create an xml_schema::type directly from it. Thanks, Matt Matt Burnham wrote: > Hi Boris, > > I've been trying to get my embedded sub-schemas to work, both through > the "keep-dom" and "substitution group" approach. I haven't had any > luck with either one and have put together 2 different test cases. In > the code I've put comments where I either have compile errors or where > an exception gets thrown. All of this testing was done using version > 2.1.1 on Windows XP, and Visual Studio 7.1. I'd like to get both of > these working, then I can use either approach, though I'm leaning > towards modifying the schemas and using the substitution groups approach. > > Here are the issues that I'm having: > > 1 - Trying to acces a container directly won't compile (in both > approaches). > event::detail::container dtl = obj->detail(); // this compiles > event::detail& dtl = obj->detail().get(); // this doesn't > > 2 - In the substitution group approach, converting the "content" to an > xml_schema::type won't compile (see test_sg.cxx): > xml_schema::type& c( dtl.get().content() ); // error: 'content' > : is not a member of 'detail' > > 3 - Trying to accessing non-embedded data when using keep-dom throws > an exception (see test_dom.cxx accessing "stuff"). I'm sure I'm > probably doing something wrong here, but can't figure out what. > event::stuff::type stuff = obj->stuff(); // throws an exception > > 4 - In the keep-dom approach, I cast the contents of the detail > container to a DOMElement and create the DOMElement (see > test_dom.cxx). When I then try and acces this DOMElement, it throws > an exception. > xercesc::DOMElement* de( > static_cast(dtl.get()._node()) ); > xercesc::DOMNodeList* nl( de->getElementsByTagName(ename) ); // > this throws an exception > > I'm attaching a zip file containing these 2 test cases, including a > solution and project files. Here is a list of some of the files: > test_dom\event_dom.xsd - core schema for keep-dom parsing test > test_dom\embedded_dom.xsd - sub-schema for keep-dom parsing test > test_dom\test_dom.cxx - driver app for keep-dom parsing test > test_sg\event_sg.xsd - core schema for substitution group test > test_sg\ embedded_sg.xsd - sub-schema for substitution group test > test_sg\ test_sg.cxx - driver app for substitution group test > test_*\test_event.xml - example input file > > I've also, added a comment in the test apps showing how the cxx-tree > was created. > > Thanks, > Matt > From boris at codesynthesis.com Fri Jun 30 09:50:32 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:47 2009 Subject: [xsd-users] Re: Accessing embedded sub-schemas In-Reply-To: <44A45BD5.3020607@mhpcc.hpc.mil> References: <44A1F4C0.5050702@mhpcc.hpc.mil> <20060628155330.GA19911@karelia> <44A2DD48.8050504@mhpcc.hpc.mil> <20060629092207.GB22290@karelia> <44A43FB2.802@mhpcc.hpc.mil> <44A45BD5.3020607@mhpcc.hpc.mil> Message-ID: <20060630135032.GA7939@karelia> Hi Matt, Matt Burnham writes: > From my previous email the issue with, "Trying to access a container > directly won't compile", works if I do this. > event::detail::type& dtl = obj->detail().get(); > instead of > event::detail& dtl = obj->detail().get(); Right, that should work. > When I make this change in the keep-dom approach, I can now create a > valid DOMElement, and the exception (since the DOMElement created was > NULL) goes away. I'm now down to actually "parsing" the embedded schema > using the following code: > class embedded edata( ede ); > This doesn't work, and the only "Dom" constructor I find for the > embedded class takes a DOMDocument. I've gone through the xerces API > docs and can't find any way to create a DOMDocument from the DOMElement, > or to simply create a string/stream,etc from the DOMElement). Try compiling your tmp_embedded.xsd with the --morph-anonymous and --root-element-none options. This will result in only embedded_data class being generated. Then you can use: embedded_data edata (ede, 0, 0); > Also, in the substitution group approach, I can also access the detail > container directly, but still can't create an xml_schema::type directly > from it. If 'detail' has the following definition then you can write something like this: detail& d = ... for (detail_type::content::iterator i (d.content ().begin ()); i != d.content ().end (); ++i) { xml_schema::type& c = *i; if (embedded_data* ed = dynamic_cast (&c)) { // Got embedded_data } } BTW, I downloaded the CoT schemas and now I can see where this design is coming from. hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060630/68aa9dbf/attachment.pgp