From Paul.McGrath at BellshireTechnologies.com Fri Dec 1 15:27:27 2006 From: Paul.McGrath at BellshireTechnologies.com (Paul McGrath) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] MatMLschema supported? Message-ID: <01a601c71587$1ec0ab60$0201a8c0@btcae> Has anyone had success with MatML schema the xml for material property data? http://www.matml.org/ From boris at codesynthesis.com Sat Dec 2 15:37:58 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] MatMLschema supported? In-Reply-To: <01a601c71587$1ec0ab60$0201a8c0@btcae> References: <01a601c71587$1ec0ab60$0201a8c0@btcae> Message-ID: <20061202203758.GB30904@karelia> Hi Paul, Paul McGrath writes: > Has anyone had success with MatML schema the xml for material property data? > http://www.matml.org/ I just tried the compile MatML schema and everything works fine. I created a small test application (below) which read in the data, dumps it to the terminal and saves the object model back to XML. I tried it on the examples I got from the website and everything works fine (note that I had to change http://www.w3.org/2000/10/XMLSchema-instance to http://www.w3.org/2001/XMLSchema-instance since that's the correct URI and also the third example contains invalid characters for UTF-8). I tried it on both GNU/Linux with GCC 4.1.1 and Windows with VC++ 7.1. For the test below I used the following command line to compile the schema: xsd cxx-tree --generate-ostream --generate-serialization matml31.xsd You can also use the --morph-anonymous option if you would like to name a few anonymous types found in the schema. hth, -boris #include #include #include #include "matml31.hxx" using namespace std; int main (int argc, char* argv[]) { if (argc != 2) { cerr << "usage: " << argv[0] << " " << endl; return 1; } try { auto_ptr doc (MatML_Doc (argv[1])); cout << *doc << endl; ofstream ofs ("out.xml"); xml_schema::namespace_infomap map; map[""].schema = "matml31.xsd"; MatML_Doc (ofs, *doc, map); } catch (const xml_schema::exception& e) { cerr << e << endl; return 1; } } -------------- 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/20061202/cf3f2b20/attachment.pgp From boris at codesynthesis.com Tue Dec 5 06:14:59 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] XSD 2.3.1.b2 released Message-ID: <20061205111459.GC11167@karelia> Hi, We have released 2.3.1.b2 which is the second beta and a release candidate for the upcoming 2.3.1 maintenance release. The NEWS file entries so far are as follows: * The compiler is now capable of translating multiple schemas in one invocation. * New option, --sloc-limit, allows one to limit the amount of the generated code. * New option, --proprietary-license, instructs the compiler not to include the GPL banner in each generated file. Instead a short notice about a required proprietary license is generated. You should not use this option unless you have obtained a proprietary license from Code Synthesis Tools CC. C++/Tree * The --parts option has been improved to split generated code more evenly by analyzing the complexity of the generated schema constructs. * Optimizations for the run-time memory consumption. * Optimizations for space in the generated code. * Number of bug fixes. C++/Parser * Proper handling of an xsd:any nested content. Nested elements, attributes, and text are reported via _any_* hooks of the current parser. * Number of bug fixes, mostly in the generated validation code. In addition, this release adds support for Intel C++ 9.1 on GNU/Linux and Windows as well as IBM XL C++ 7.0 and 8.0 on GNU/Linux and AIX. A precompiled binary for AIX is coming soon. Thanks to the following individuals for reporting bugs as well as suggesting fixes and improvements: Patrick Shinpaugh Harish Prasad Eric Hasan Precompiled binary distributions are available from the product's download page: http://www.codesynthesis.com/products/xsd/download.xhtml Source code for this release is available from the project's web page: http://www.codesynthesis.com/projects/xsd/ SHA1 checksums for the files: 48ec310e43ee96640217247eeb6cc070655ba501 xsd-2.3.1.b2.tar.bz2 ff1781b7b0f2267daba82e8cdd5b8067f623bb2d xsd-2.3.1.b2-i686-linux-gnu.tar.bz2 f57731c1bcee2fe917e61737375d68a5fcb19a21 xsd-2.3.1.b2-x86_64-linux-gnu.tar.bz2 f0e7d0bc373a2371459fc457a9e224b17ac11da5 xsd-2.3.1.b2-i686-windows.zip have fun, -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/20061205/cd63fad6/attachment.pgp From dstockdi at csc.com Tue Dec 5 20:01:09 2006 From: dstockdi at csc.com (David J Stockdill) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] losing double precision in output xml Message-ID: I have just started using xsd & it has been great so far. I am having one problem however with type xsd:double losing precision. I have a double type that has a value like 38.3333333338 and the generated XML is 38.3. This sounds like the same issue as one I found in the archives: [xsd-users] losing double precision in output xml (msvc++7.1) (March 15, 2006) The solution was a bug fix in version 2.0.0-2. I am running xsd-2.3.1.b1-i686-windows. Would that fix be included in this version? Am I missing an XSD option? Thank you, Dave From boris at codesynthesis.com Wed Dec 6 02:37:30 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] losing double precision in output xml In-Reply-To: References: Message-ID: <20061206073730.GB19811@karelia> Hi David, David J Stockdill writes: > I have just started using xsd & it has been great so far. I am having one > problem however with type xsd:double losing precision. I have a double > type that has a value like 38.3333333338 and the generated XML is 38.3. > This sounds like the same issue as one I found in the archives: > > [xsd-users] losing double precision in output xml (msvc++7.1) (March 15, > 2006) > > The solution was a bug fix in version 2.0.0-2. I am running > xsd-2.3.1.b1-i686-windows. Would that fix be included in this version? Am > I missing an XSD option? Hm, that's odd. I've just tried xsd-2.3.1.b2-i686-windows (which has the same parsing/serialization code as 2.3.1.b1) on a small test and the above value gets serialized fully. I tested it with both VC++ 7.1 and 8.0. Can you try the following test case for me: #include #include using namespace std; int main () { istringstream is ("38.3333333338"); double d; is >> d; cerr.precision (13); cerr << d << endl; } Also which C++ compiler are you using? If the above test passes, would it be possible for you to create 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/20061206/067424d1/attachment.pgp From gmoutsouroufis at bytemobile.com Wed Dec 6 12:59:18 2006 From: gmoutsouroufis at bytemobile.com (George Moutsouroufis) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] troubleshooting a bug. Message-ID: <925076E4B7FDBA47903E07BB6C89F3FD123C75@bedc-exchange01.bytemobile.com> I make the code with ./xsd cxx-tree hello.xsd g++ -I/root/moutsour/generator/xsd-2.3.0-sparc-solaris/libxsd -I/root/moutsour/isn/osnr.isn-1_3_0_patches/osnr/thirdparty/xerces/include driver.cxx -lxerces-c ?lsocket and I got the following error: Undefined first referenced symbol in file hello_type::greeting() /var/tmp//ccCAgji7.o hello(std::basic_string, std::allocator > const&, xsd::cxx::tree::flags, xsd::cxx::tree::properties const&)/var/tmp//ccCAgji7.o hello_type::name() /var/tmp//ccCAgji7.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status My gcc is : gcc --version gcc (GCC) 3.2.3 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. And I am using solaris 8 uname -a SunOS v240 5.8 Generic_117350-24 sun4u sparc SUNW,Sun-Fire-V240 Thank you in advance George Moutsouroufis , Greece P.C. fantastic job , really like it From boris at codesynthesis.com Wed Dec 6 14:57:56 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] troubleshooting a bug. In-Reply-To: <925076E4B7FDBA47903E07BB6C89F3FD123C75@bedc-exchange01.bytemobile.com> References: <925076E4B7FDBA47903E07BB6C89F3FD123C75@bedc-exchange01.bytemobile.com> Message-ID: <20061206195756.GA20983@karelia> Hi George, George Moutsouroufis writes: > g++ -I/root/moutsour/generator/xsd-2.3.0-sparc-solaris/libxsd \ > -I/root/moutsour/isn/osnr.isn-1_3_0_patches/osnr/thirdparty/xerces/include \ > driver.cxx -lxerces-c -lsocket You forgot to compile in the generated code. Try adding hello.cxx to the command line, e.g.: g++ ... driver.cxx hello.cxx -lxerces-c -lsocket > P.C. fantastic job , really like it Thanks, we are really glad you like it. -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/20061206/094bf252/attachment.pgp From Stuart_Brock at adp.com Wed Dec 6 17:32:18 2006 From: Stuart_Brock at adp.com (Brock, Stuart x66259) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] Request for binaries for the hp NonStop OSS platform... Message-ID: I wanted to download XSD, but the binaries are not available for the system that I want to run XSD on. This is not surprising as the system I am using is rather obscure. Once known as the Tandem, the architecture is now owned by hp and is known as NonStop OSS. I doubt that you will be able to supply binaries for this system. However, if I could get the source code, I would gladly port XSD to the NonStop platform. Thank you for your assistance, Stu From boris at codesynthesis.com Thu Dec 7 10:24:21 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] losing double precision in output xml In-Reply-To: References: Message-ID: <20061207152421.GA23270@karelia> Hi David, I've CC'ed xsd-users to my reply so that others can benefit from this information. David J Stockdill writes: > 38.200000000001 is truncated to 38.2 > 38.20000000001 is not. How do I specify to keep more than 11 digets after > the decimal? I think I have finally found the right formula for the serialization precision of floating-point types. See this paper for details: http://www2.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf The fix is available here: http://codesynthesis.com/download/xsd/2.3/xsd-2.3.0-fp-serialization-patch.zip http://codesynthesis.com/download/xsd/2.3/xsd-2.3.0-fp-serialization-patch.tar.gz Simply replace the libxsd/xsd/cxx/tree/serialization.hxx file with the new revision. This fix will also appear in the upcoming 2.3.1 version. Please let me know if things are working now and thanks for helping to track this problem down! -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/20061207/bb37493f/attachment.pgp From boris at codesynthesis.com Thu Dec 7 10:49:26 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] Request for binaries for the hp NonStop OSS platform... In-Reply-To: References: Message-ID: <20061207154926.GB23270@karelia> Hi Stuart, Brock, Stuart x66259 writes: > I wanted to download XSD, but the binaries are not available for the system > that I want to run XSD on. This is not surprising as the system I am using > is rather obscure. Once known as the Tandem, the architecture is now owned > by hp and is known as NonStop OSS. I doubt that you will be able to supply > binaries for this system. However, if I could get the source code, I would > gladly port XSD to the NonStop platform. Source code (as well as build instructions) are available from this page: http://codesynthesis.com/projects/xsd/ A couple of things I would like to mention: 1. You may want to first try to build a sample application (e.g., 'hello' or 'library' from examples) by generating the code on some other box. This should be fairly easy since the runtime library is header-only. This way you will be able to check if the C++ compiler available on NonStop is able to compile the generated code. 2. We only use g++ to build the compiler itself. I am not sure if there is GCC port for NonStop. If there is I suggest you go directly with g++ (you can still compile your applications with the native compiler). If you run into any problems or need assistance please feel free to post to this mailing list. And please let us know about your progress. -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/20061207/373e7721/attachment.pgp From dstockdi at csc.com Thu Dec 7 11:02:53 2006 From: dstockdi at csc.com (David J Stockdill) Date: Sun Oct 11 15:33:50 2009 Subject: [xsd-users] losing double precision in output xml In-Reply-To: <20061207152421.GA23270@karelia> Message-ID: Boris, That did it. Thank you for the swift support. Dave David J. Stockdill Boris Kolpackov To David J Stockdill/DEF/CSC@CSC 12/07/2006 10:24 cc AM xsd-users@codesynthesis.com Subject Re: [xsd-users] losing double precision in output xml Hi David, I've CC'ed xsd-users to my reply so that others can benefit from this information. David J Stockdill writes: > 38.200000000001 is truncated to 38.2 > 38.20000000001 is not. How do I specify to keep more than 11 digets after > the decimal? I think I have finally found the right formula for the serialization precision of floating-point types. See this paper for details: http://www2.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf The fix is available here: http://codesynthesis.com/download/xsd/2.3/xsd-2.3.0-fp-serialization-patch.zip http://codesynthesis.com/download/xsd/2.3/xsd-2.3.0-fp-serialization-patch.tar.gz Simply replace the libxsd/xsd/cxx/tree/serialization.hxx file with the new revision. This fix will also appear in the upcoming 2.3.1 version. Please let me know if things are working now and thanks for helping to track this problem down! -boris (See attached file: signature.asc) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/octet-stream Size: 666 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061207/40e6eb32/signature.obj From ac22750085 at yahoo.com Thu Dec 7 18:13:00 2006 From: ac22750085 at yahoo.com (Ac22750085@yahoo.com) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Please help on this C++ code test_parser.cxx Message-ID: <20061207231300.40881.qmail@web50810.mail.yahoo.com> Hi: Attached please find a jar file test_parser.jar which includes your example for hello.xsd and my schema file cart_conf.xsd I have generated the header file cart_conf.hxx and the template file cart_conf.txx successfully for the cart_conf.xsd schema file then I mimic your test program driver.cxx and wrote a test program called test_parser.cxx and tried to print out the information cart_conf_version, cartconf_name and cartconf_revision out from the cart_conf.xml file but it only prints out the debug statements. test_parser cart_conf.xml parsing the document... please wait before calling cart_conf_version_parser after calling cart_conf_version_parser Could you look the program test_parser.cxx to see what I did wrong Thanks and Best Regards, Paul --------------------------------- Everyone is raving about the all-new Yahoo! Mail beta. -------------- next part -------------- A non-text attachment was scrubbed... Name: test_parser.jar Type: application/x-jar Size: 190974 bytes Desc: 414051843-test_parser.jar Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061207/ec1d4d3f/test_parser.bin From boris at codesynthesis.com Fri Dec 8 09:21:28 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Please help on this C++ code test_parser.cxx In-Reply-To: <20061207231300.40881.qmail@web50810.mail.yahoo.com> References: <20061207231300.40881.qmail@web50810.mail.yahoo.com> Message-ID: <20061208142128.GA1820@karelia> Hi Paul, Ac22750085@yahoo.com writes: > Attached please find a jar file test_parser.jar which includes > your example for hello.xsd and my schema file cart_conf.xsd Thanks. In the future please refrain from sending generated code and executables -- XML file, schema file and your implementation are usually enough. > I have generated the header file cart_conf.hxx and the > template file cart_conf.txx successfully for the cart_conf.xsd > schema file then I mimic your test program driver.cxx and > wrote a test program called test_parser.cxx and tried to print > out the information cart_conf_version, cartconf_name and > cartconf_revision out from the cart_conf.xml file > but it only prints out the debug statements. > > [...] > > Could you look the program test_parser.cxx to see what I did wrong It does not work because you parser structure does not correspond to the document structure. For example, you are trying to parse a root element of the document with the header_infoType parser. Here is a working parser for the root element to get you started: struct cartconf_parser: cartconf { virtual void cart_conf_version (const string& v) { cout << "version: " << v << endl; } }; xml_schema::string string_p; cartconf_parser cartconf_p; cartconf_p.cart_conf_version_parser (string_p); xml_schema::document doc_p (cartconf_p, "cartconf"); Now in order to get to the name and revision, you will first need to implement a parser for cart_header and plug it into cartconf after the version. Only then you can get to the header_infoType parser which should be plugged to the cart_header parser. 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/20061208/aa6b739a/attachment.pgp From david.r.moss at selex-comm.com Tue Dec 12 12:46:21 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] #include directives & relative paths In-Reply-To: <20061208142128.GA1820@karelia> Message-ID: All, Using xsd-2.3.1.b2-i686-windows and given the following file structure on my disk: --+ root + base + schema basic-types.xsd + generated basic-types.hxx + derived + schema derived-types.xsd + generated derived-types.hxx And the following snippets of the xsd files shown above: basic-types.xsd: // ... derived-types.xsd: // ... Both schemas are compiled with, amongst other things, --include-with-brackets and --output-dir ./generated I have this problem: The #include directive in derived-types.hxx is #include <../../root/schema/basic-types.hxx> Which doesn't exist. I'd like to not have to specify the relative path of the base schema on the import line and instead use just the file name with the --include-prefix "generated" command to produce an include directive #include which will build since my build environment finds it in the path. This can't be done as xsd can't find the base schema without the relative path and so doesn't generate the code. Any ideas? Hope this makes some kind of sense! 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 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** From boris at codesynthesis.com Tue Dec 12 13:47:18 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] xsd-2.3.1.b2-powerpc-aix released Message-ID: <20061212184718.GI13316@karelia> Hi, We've released a precompiled binary of XSD 2.3.1.b2 for IBM AIX 5.2 and 5.3 on POWER and PowerPC. It was tested with IBM XL C++ 7.0 and 8.0 as well as GNU g++ 3.3.x-4.1.x The binary can be downloaded from the usual place: http://www.codesynthesis.com/products/xsd/download.xhtml The SHA1 checksum for the file is as follows: e48fbb4b0c7647b52bd45a9d2ebda779d9e23981 xsd-2.3.1.b2-powerpc-aix.tar.gz Those of you who are interested in building self-sufficient binaries for AIX with GNU g++ may be interested in the following "war story" blog post: http://codesynthesis.com/~boris/blog/2006/12/10/statically-linking-on-aix/ Have fun, -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/20061212/b48febf0/attachment.pgp From boris at codesynthesis.com Wed Dec 13 03:10:34 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] #include directives & relative paths In-Reply-To: References: <20061208142128.GA1820@karelia> Message-ID: <20061213081034.GA18400@karelia> Hi David, Long time, no see ;-) Moss, David R (SELEX Comms) (UK Christchurch) writes: > --+ root > + base > + schema > basic-types.xsd > + generated > basic-types.hxx > > + derived > + schema > derived-types.xsd > + generated > derived-types.hxx > > > [...] > > I have this problem: > > The #include directive in derived-types.hxx is > > #include <../../root/schema/basic-types.hxx> > > Which doesn't exist. I'd like to not have to specify the relative path > of the base schema on the import line and instead use just the file name > with the > > --include-prefix "generated" > > command to produce an include directive > > #include > > which will build since my build environment finds it in the path. Hm, right now --include-prefix is just added to the full path from the schema include statement: #include One way to address this would be to have an option to strip the directory part from the path before applying --include-prefix, so that we end up with #include The problems with this solution are as follows: 1. It will strip the directory part from all paths. It is quite possible one may want to keep it in some #include's and strip it in others. 2. What if one wants to strip only a part of the directory. For example what if you wanted your #include directive to be relative to root: #include So it seems to me like a full-blown regex replacement mechanism is in order here. It will address both of the above problems and will allow one to implement non-trivial transformations on the include paths. What do you think? 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/20061213/5ed157a4/attachment.pgp From david.r.moss at selex-comm.com Wed Dec 13 04:23:20 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] #include directives & relative paths In-Reply-To: <20061213081034.GA18400@karelia> Message-ID: Hi Boris, See comments below. 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 > > Hi David, > > Long time, no see ;-) [Moss, David R] Thanks, I've been very busy :-) > > Hm, right now --include-prefix is just added to the full path from > the schema include statement: > > #include [Moss, David R] Yes, I saw that, which made sense after I thought about it - and sorry for the inconsistency in my example there; some 'real' code leaked in! > > One way to address this would be to have an option to strip the directory > part from the path before applying --include-prefix, so that we end up > with > > #include > > The problems with this solution are as follows: > > 1. It will strip the directory part from all paths. It is quite possible > one may want to keep it in some #include's and strip it in others. [Moss, David R] Agreed. > 2. What if one wants to strip only a part of the directory. For example > what if you wanted your #include directive to be relative to root: > > #include [Moss, David R] That's sounds like a useful feature too. > So it seems to me like a full-blown regex replacement mechanism is in > order here. It will address both of the above problems and will allow > one to implement non-trivial transformations on the include paths. > What do you think? [Moss, David R] That would be the most flexible solution. Just to clarify: Are these XSD commands applied after the schema file has been parsed? If this is the case then there is still the issue of having to specify complete paths in the actual schema file for include and import statements to compile without error: 'schema\basic-types.xsd': unable to open in read mode messages - by the way, wouldn't 'file not found at ' be a more accurate message here :-) Is it possible for XSD to check the 'path' environment variable to get round this; a --use-path command or similar? Or would this just be violating the standards?! > > > thanks, > -boris ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** From boris at codesynthesis.com Wed Dec 13 04:40:05 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] #include directives & relative paths In-Reply-To: References: <20061213081034.GA18400@karelia> Message-ID: <20061213094005.GB18400@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > Just to clarify: Are these XSD commands applied after the schema file > has been parsed? If this is the case then there is still the issue of > having to specify complete paths in the actual schema file for include > and import statements to compile without Yes, the transformations are applied after the schemas have been parsed. They specify how XML Schema include and import declarations are mapped to C++ #include directives. > error: 'schema\basic-types.xsd': unable to open in read mode > > messages - by the way, wouldn't 'file not found at ' be a more > accurate message here :-) It definitely would but it would also require digging further for the reason why the open failed. It can be because the file is not present, you don't have permissions, or your hard drive head just scratched the platter :-). When you factor in the platform differences, it becomes a somewhat complicated matter. That's why XSD simply prints what it tried to do and that the operation has failed. > Is it possible for XSD to check the 'path' environment variable to get > round this; a --use-path command or similar? Or would this just be > violating the standards?! I was thinking about adding an option similar to CPP's -I for include/import directory searching but decided against it. This is something that no other schema processor is supporting so such a feature will lead you to developing schemas that are not usable with anything except XSD. I think using relative paths is a pretty standard and universally-supported practice. With the new --include-regex option you will be able to transform those paths to use more powerful features of the C++ preprocessor. I am going to implement the --include-regex option. Would you like a precompiled binary? 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/20061213/ff88f449/attachment.pgp From david.r.moss at selex-comm.com Wed Dec 13 06:00:09 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] #include directives & relative paths In-Reply-To: <20061213094005.GB18400@karelia> Message-ID: Boris, I thought there may have been a standards issue with that - never mind! A precompiled binary would be great, thanks for the swift reply. 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 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** From david.r.moss at selex-comm.com Wed Dec 13 14:10:44 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Substitution groups & different namespaces. In-Reply-To: <20061213094005.GB18400@karelia> Message-ID: All, Given the attached files, using xsd-2.3.1.b2-i686-windows and the command --generate-polymorphic among others, when trying to load the xml file: auto_ptr db( Base::UserDatabase( "test-users.xml" ) ); an exception is thrown stating: "There is no Grammar for uri: ." I'm thinking it has something to do with the derived xsi:type specified in the XML file being in a different (i.e. not in one at all) namespace to the Base types. Any help greatly appreciated. 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 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users.xml Type: text/xml Size: 338 bytes Desc: test-users.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061213/1a8d3011/test-users.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: derived-user-config.xsd Type: application/octet-stream Size: 744 bytes Desc: derived-user-config.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061213/1a8d3011/derived-user-config.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test-user-config.xsd Type: application/octet-stream Size: 595 bytes Desc: test-user-config.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061213/1a8d3011/test-user-config.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users.xsd Type: application/octet-stream Size: 555 bytes Desc: test-users.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061213/1a8d3011/test-users.obj From beddoes at intient.com Thu Dec 14 01:48:02 2006 From: beddoes at intient.com (Bradley Beddoes) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems Message-ID: <4580F3A2.2080102@intient.com> Hi, I am attempting to compile a schema using XSD and am running into problems around the ##any types it defines, the reported errors are: saml-schema-protocol-2.0.xsd:50:56: error: element 'Signature' is defined here saml-schema-protocol-2.0.xsd:229:81: error: such wildcards are not supported saml-schema-protocol-2.0.xsd:229:81: error: namespace '##any' allows for element 'Extensions' saml-schema-protocol-2.0.xsd:51:60: error: element 'Extensions' is defined here saml-schema-protocol-2.0.xsd:229:81: error: such wildcards are not supported saml-schema-protocol-2.0.xsd:229:81: error: namespace '##any' allows for element 'Status' saml-schema-protocol-2.0.xsd:52:42: error: element 'Status' is defined here saml-schema-protocol-2.0.xsd:229:81: error: such wildcards are not supported The schema is available from: http://docs.oasis-open.org/security/saml/v2.0/saml-schema-protocol-2.0.xsd The corresponding piece of schema is: Command: ./xsd cxx-tree --show-sloc --generate-polymorphic --namespace-map http://www.w3.org/2001/04/xmlenc#=w3::xmlenc --namespace-map http://www.w3.org/2000/09/xmldsig#=w3::xmldsig --namespace-map urn:oasis:names:tc:SAML:2.0:assertion=saml::assertion --namespace-map urn:oasis:names:tc:SAML:2.0:metadata=saml::metadata --namespace-map urn:oasis:names:tc:SAML:2.0:protocol=saml::protocol --output-dir......... There is another instance of ##any in the same schema file which seems to pass by without problem, I have looked at the various pieces of documentation and can't seem to determine if there is any specific flag I should be setting to get this to operate correctly. Can anyone please advise if XSD should be able to compile this schema and if so what I might be doing wrong? The "such wildcards are not supported" statement is a bit of a concern. thanks, Bradley From boris at codesynthesis.com Thu Dec 14 03:50:52 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Re: Substitution groups & different namespaces. In-Reply-To: References: <20061213094005.GB18400@karelia> Message-ID: <20061214085052.GB21817@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > an exception is thrown stating: > > "There is no Grammar for uri: ." > > I'm thinking it has something to do with the derived xsi:type specified > in the XML file being in a different (i.e. not in one at all) namespace > to the Base types. Here is what happens: (1) you have XML Schema validation enabled in the underlying parser and (2) you specify a type in xsi:type attribute for which there is no schema can be found. Here are the number of ways in which you can address this: 1. Specify the schema where the type is defined with, in your case, the xsi:noNamespaceSchemaLocation attribute: With this fix the parsing results in the following error, which makes sense: test-users.xml:7:60 error: Type 'DerivedUserConfig_t' that is used in xsi:type is not derived from the type of element 'UserDatabase' You can also use Xerces-C++ API for loading and caching schemas. Let me know if you would like more pointers on this. 2. Disable validation in the underlying parser with the xml_schema::flags::dont_validate flag: auto_ptr db( Base::UserDatabase( "test-users.xml", xml_schema::flags::dont_validate) ); 3. Use "lax" validation in the underlying parser. Lax validation means that the instance will be validated only of the schema can be found. In your case that would mean that the XML instance will be validated while DerivedUserConfig_t won't. There is no XSD flag to request lax validation yet. 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/20061214/a92f0b62/attachment.pgp From david.r.moss at selex-comm.com Thu Dec 14 04:52:44 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] RE: Substitution groups & different namespaces. In-Reply-To: <20061214085052.GB21817@karelia> Message-ID: Boris, I think I've misunderstood xsi:type - if I rewrite the instance document using xsi:noNamespaceSchemaLocation as you suggest: fred bob 50 I can mix basic and derived user types and get validation as required. Or am I missing something? :-) 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 > -----Original Message----- > From: Boris Kolpackov [mailto:boris@codesynthesis.com] > Sent: 14 December 2006 08:51 > To: Moss, David R (SELEX Comms) (UK Christchurch) > Cc: xsd-users@codesynthesis.com > Subject: Re: Substitution groups & different namespaces. > > Hi David, > > Moss, David R (SELEX Comms) (UK Christchurch) comm.com> writes: > > > an exception is thrown stating: > > > > "There is no Grammar for uri: ." > > > > I'm thinking it has something to do with the derived xsi:type specified > > in the XML file being in a different (i.e. not in one at all) namespace > > to the Base types. > > Here is what happens: (1) you have XML Schema validation enabled in the > underlying parser and (2) you specify a type in xsi:type attribute for > which there is no schema can be found. Here are the number of ways in > which you can address this: > > 1. Specify the schema where the type is defined with, in your case, the > xsi:noNamespaceSchemaLocation attribute: > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:type="DerivedUserConfig_t" > xsi:schemaLocation="http://www.dave.com/Base test- > users.xsd" > xsi:noNamespaceSchemaLocation="derived-user-config.xsd"> > > > > > With this fix the parsing results in the following error, which makes > sense: > > test-users.xml:7:60 error: Type 'DerivedUserConfig_t' that is used in > xsi:type is not derived from the type of element 'UserDatabase' > > You can also use Xerces-C++ API for loading and caching schemas. Let > me know if you would like more pointers on this. > > > 2. Disable validation in the underlying parser with the > xml_schema::flags::dont_validate flag: > > auto_ptr > db( Base::UserDatabase( "test-users.xml", > xml_schema::flags::dont_validate) ); > > 3. Use "lax" validation in the underlying parser. Lax validation means > that the instance will be validated only of the schema can be found. > In your case that would mean that the XML instance will be validated > while DerivedUserConfig_t won't. There is no XSD flag to request lax > validation yet. > > > hth, > -boris ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** From boris at codesynthesis.com Thu Dec 14 04:52:00 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Re: Substitution groups & different namespaces. In-Reply-To: References: <20061214085052.GB21817@karelia> Message-ID: <20061214095200.GD21817@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > I think I've misunderstood xsi:type - if I rewrite the instance document > using xsi:noNamespaceSchemaLocation as you suggest: > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.dave.com/Base > test-users.xsd" > > xsi:noNamespaceSchemaLocation="derived-user-config.xsd"> > > > fred > > > > bob > 50 > > > > > > I can mix basic and derived user types and get validation as required. > Or am I missing something? :-) This example looks right. Your original example looked like this: Here you are specifying via xsi:type that the UserDatabase element is actually of type DerivedUserConfig_t instead of UserDatabase_t but the problem is that DerivedUserConfig_t and UserDatabase_t are not related via inheritance. I think what you meant to write is this: bob 50 Which can be equivalently rewritten using substitution groups as: bob 50 Does this make sense? -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/20061214/db05a01e/attachment.pgp From david.r.moss at selex-comm.com Thu Dec 14 06:36:49 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] RE: Substitution groups & different namespaces. In-Reply-To: <20061214095200.GD21817@karelia> Message-ID: Boris, Comments below. 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 > > This example looks right. Your original example looked like this: > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:type="DerivedUserConfig_t" > xsi:schemaLocation="http://www.dave.com/Base test- > users.xsd"> > > > Here you are specifying via xsi:type that the UserDatabase element is > actually of type DerivedUserConfig_t instead of UserDatabase_t but the > problem is that DerivedUserConfig_t and UserDatabase_t are not related > via inheritance. I think what you meant to write is this: > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.dave.com/Base test- > users.xsd"> > > > bob > 50 > > > > [Moss, David R] You're right - that is what I meant. Your example needs the line xsi:noNamespaceSchemaLocation="derived-user-config.xsd" as well though? Otherwise I get unknown type DerivedUserConfig errors. Even with that line, I get unknown Age element errors... > Which can be equivalently rewritten using substitution groups as: > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.dave.com/Base test- > users.xsd"> > > > bob > 50 > > > [Moss, David R] Again, with the line xsi:noNamespaceSchemaLocation="derived-user-config.xsd" this works fine. I have a query - see comments in this code and the attached instance doc: using namespace Base; auto_ptr db( UserDatabase( "test-users.xml" ) ); UserDatabase_t::TestUserConfig::const_iterator i( db->TestUserConfig().begin() ); // This has expected output // Name: fred // Number: 6666666 cerr << *i << endl; i++; // This has expected output // Name: bob // Number: 1234567 cerr << *i << endl; const DerivedUserConfig_t* pd = dynamic_cast(&*i); // This has expected output // 50 cerr << pd->Age(); // This has unexpected output // 0x004eeac0 // Expected (or similar): // Name: fred // Number: 6666666 // Age: 50 cerr << pd; Any ideas? Obviously the data is accessible so it's not going to cause any real problems. > > Does this make sense? [Moss, David R] Yes, thanks. Sorry for taking up so much of your time! > > > -boris ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users.xml Type: text/xml Size: 689 bytes Desc: test-users.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061214/a042dbec/test-users.bin From boris at codesynthesis.com Thu Dec 14 07:26:47 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Re: Substitution groups & different namespaces. In-Reply-To: References: <20061214095200.GD21817@karelia> Message-ID: <20061214122647.GE21817@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > You're right - that is what I meant. Your example needs the line > xsi:noNamespaceSchemaLocation="derived-user-config.xsd" as well though? Correct. > Again, with the line > xsi:noNamespaceSchemaLocation="derived-user-config.xsd" this works fine. Right. > const DerivedUserConfig_t* pd = > dynamic_cast(&*i); > > // This has expected output > // 50 > cerr << pd->Age(); > > // This has unexpected output > // 0x004eeac0 > // Expected (or similar): > // Name: fred > // Number: 6666666 > // Age: 50 > cerr << pd; I think you need to dereference the pointer: cerr << *pd; 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/20061214/7337274f/attachment.pgp From boris at codesynthesis.com Thu Dec 14 09:30:02 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] #include directives & relative paths In-Reply-To: References: <20061213094005.GB18400@karelia> Message-ID: <20061214143002.GA26166@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > A precompiled binary would be great, thanks for the swift reply. The binary is available at http://codesynthesis.com/~boris/tmp/xsd-2.3.1.b2-2-i686-windows.zip The two new options are --include-regex and --include-regex-trace. With the first one you can provide a regular expression that will be used to transform #include paths. The second one is useful for debugging. For your case, I think, a regex like this should do the trick: #.+/([^/]+)#generated/$1# Let me know if there are any problems. -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/20061214/a8816f50/attachment.pgp From boris at codesynthesis.com Thu Dec 14 10:02:19 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <4580F3A2.2080102@intient.com> References: <4580F3A2.2080102@intient.com> Message-ID: <20061214150219.GB26166@karelia> Hi Bradley, Bradley Beddoes writes: > saml-schema-protocol-2.0.xsd:229:81: error: namespace '##any' allows for > element 'Status' > saml-schema-protocol-2.0.xsd:52:42: error: element 'Status' is defined here > saml-schema-protocol-2.0.xsd:229:81: error: such wildcards are not supported > > The schema is available from: > http://docs.oasis-open.org/security/saml/v2.0/saml-schema-protocol-2.0.xsd > > The corresponding piece of schema is: > > > > > > > minOccurs="0"/> > > > > The special ##any namespace name indicates that an element from any namespace, including the target namespace of the schema, can appear. As a result, in order to support this widlcard in general case, one needs to perform full-blown structure validation in order to determine which elements are matched by which schema declaration. In the example above, an element with name 'Status' can appear for the wildcard which will make the current parsing code fail to associate this element properly. That's why XSD detects such cases and refuses to generate the code. > There is another instance of ##any in the same schema file which seems > to pass by without problem, That usage is fine since there are no other elements in that type. > Can anyone please advise if XSD should be able to compile this schema > and if so what I might be doing wrong? The "such wildcards are not > supported" statement is a bit of a concern. It is rarely an intention of a schema author to allow elements from the same schema to appear in the wildcard. So the first thing I suggest you do is check the semantic of the type and whether you can replace ##any with ##other. I will also take some time to think if there is a way to support this without implementing full-blown structure validation. 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/20061214/966fcf7c/attachment.pgp From beddoes at intient.com Sun Dec 17 18:20:37 2006 From: beddoes at intient.com (Bradley Beddoes) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <20061214150219.GB26166@karelia> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> Message-ID: <4585D0C5.2030509@intient.com> Hello Boris, Boris Kolpackov wrote: > Hi Bradley, > > Bradley Beddoes writes: > >> saml-schema-protocol-2.0.xsd:229:81: error: namespace '##any' allows for >> element 'Status' >> saml-schema-protocol-2.0.xsd:52:42: error: element 'Status' is defined here >> saml-schema-protocol-2.0.xsd:229:81: error: such wildcards are not supported >> >> The schema is available from: >> http://docs.oasis-open.org/security/saml/v2.0/saml-schema-protocol-2.0.xsd >> >> The corresponding piece of schema is: >> >> >> >> >> >> >> > minOccurs="0"/> >> >> >> >> > > The special ##any namespace name indicates that an element from any > namespace, including the target namespace of the schema, can appear. > As a result, in order to support this widlcard in general case, one > needs to perform full-blown structure validation in order to determine > which elements are matched by which schema declaration. In the example > above, an element with name 'Status' can appear for the wildcard > which will make the current parsing code fail to associate this > element properly. That's why XSD detects such cases and refuses > to generate the code. Yes thats exactly how it is intended to be used here in the SAML schema, ArtifactResponse the element having problems may contain any message from the SAML protocol when it is being transmitted > > >> There is another instance of ##any in the same schema file which seems >> to pass by without problem, > > That usage is fine since there are no other elements in that type. Understood. > > >> Can anyone please advise if XSD should be able to compile this schema >> and if so what I might be doing wrong? The "such wildcards are not >> supported" statement is a bit of a concern. > > It is rarely an intention of a schema author to allow elements from > the same schema to appear in the wildcard. So the first thing I suggest > you do is check the semantic of the type and whether you can replace > ##any with ##other. I will also take some time to think if there is > a way to support this without implementing full-blown structure > validation. It is definitely the desire of the authors of the schema (OASIS standards body) to use ##any here, and its something I can't change personally but do need to support it. What sort of work would be required to support this? > > > hth, > -boris From boris at codesynthesis.com Mon Dec 18 04:48:07 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <4585D0C5.2030509@intient.com> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> <4585D0C5.2030509@intient.com> Message-ID: <20061218094807.GD5816@karelia> Hi Bradley, Bradley Beddoes writes: > Yes thats exactly how it is intended to be used here in the SAML schema, > ArtifactResponse the element having problems may contain any message > from the SAML protocol when it is being transmitted Can it contain any of the elements from StatusResponseType (from which ArtifactResponseType inherits): Issuer, Signature, Extensions, or Status? If the wildcard is supposed to carry payload then I think it is unlikely to contain these "header" elements. If that's the case then you could ignore the error (with an appropriate command line option that I can add). > What sort of work would be required to support this? There are two ways to support ##any in general case that I can think of at the moment: 1. Implement full-blown structure validation. This is a lot of work and also has other negative consequences such as significantly increasing object code size. At the moment we are working on a hybrid Parser/Tree mapping which will support validation in the generated code. 2. Use Xerces-C++ post-schema validation infoset (PSVI) to figure out associations. This shouldn't be too hard to implement and probably won't increase the generated code by too much. The only significant limitation of this approach is that it will only work with validation enabled. 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/20061218/1d0fd2c6/attachment.pgp From beddoes at intient.com Mon Dec 18 05:46:43 2006 From: beddoes at intient.com (Bradley Beddoes) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <20061218094807.GD5816@karelia> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> <4585D0C5.2030509@intient.com> <20061218094807.GD5816@karelia> Message-ID: <45867193.3030103@intient.com> Hello Boris, Boris Kolpackov wrote: > Hi Bradley, > > Bradley Beddoes writes: > >> Yes thats exactly how it is intended to be used here in the SAML schema, >> ArtifactResponse the element having problems may contain any message >> from the SAML protocol when it is being transmitted > > Can it contain any of the elements from StatusResponseType (from > which ArtifactResponseType inherits): Issuer, Signature, Extensions, > or Status? If the wildcard is supposed to carry payload then I think > it is unlikely to contain these "header" elements. If that's the > case then you could ignore the error (with an appropriate command > line option that I can add). > Yes you've got it 100% correct there, those elements should not be directly represented as the any element although assuming a fuller SAML message was embedded here they may appear at some lower level in the structure ie: ... <-- substitute for any type .... .... From the way your explaining how the validator is working and the XSD code which I looked into today I assume (with lets face it little real world knowledge of the working of XSD) this wouldn't pose an immediate problem, the switch to disable the failure may be a decent option here for testing at least, in the short term I don't intend to be using the ArtifactResponseType anyway so simply getting the rest of the bindings generated successfully is much more important. Longer term we will be implementing logic to support that part of the standard. Providing that switch would be much appreciated. > >> What sort of work would be required to support this? > > There are two ways to support ##any in general case that I can think > of at the moment: > > 1. Implement full-blown structure validation. This is a lot of work > and also has other negative consequences such as significantly > increasing object code size. At the moment we are working on a > hybrid Parser/Tree mapping which will support validation in the > generated code. > > > 2. Use Xerces-C++ post-schema validation infoset (PSVI) to figure > out associations. This shouldn't be too hard to implement and > probably won't increase the generated code by too much. The only > significant limitation of this approach is that it will only > work with validation enabled. I personally don't see that as a negative thing in this case anyway or other such cases with complex schemas such as this, surely those with the need to use ##any also have the need to make sure the XML they are processing is valid. This would probably be my preferred option going forward given that we are already seeing some 17k LOC generated for saml-schema-metadata-2.0.xsd for example regards, Bradley > > > hth, > -boris From boris at codesynthesis.com Tue Dec 19 04:43:15 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <45867193.3030103@intient.com> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> <4585D0C5.2030509@intient.com> <20061218094807.GD5816@karelia> <45867193.3030103@intient.com> Message-ID: <20061219094315.GA8415@karelia> Hi Bradley, Bradley Beddoes writes: > Yes you've got it 100% correct there, those elements should not be > directly represented as the any element although assuming a fuller SAML > message was embedded here they may appear at some lower level in the > structure ie: > > > ... > <-- substitute for any type > .... > > .... > > > > From the way your explaining how the validator is working and the XSD > code which I looked into today I assume (with lets face it little real > world knowledge of the working of XSD) this wouldn't pose an immediate > problem, Only the top-level element name that matches the wildcard matters here. So there is no limitation on nested element names. > Providing that switch would be much appreciated. I am still investigating different options but can build you are binary with this check disabled. Let me know which platform you are using. > >2. Use Xerces-C++ post-schema validation infoset (PSVI) to figure > > out associations. This shouldn't be too hard to implement and > > probably won't increase the generated code by too much. The only > > significant limitation of this approach is that it will only > > work with validation enabled. > > I personally don't see that as a negative thing in this case anyway or > other such cases with complex schemas such as this, surely those with > the need to use ##any also have the need to make sure the XML they are > processing is valid. This would probably be my preferred option going > forward given that we are already seeing some 17k LOC generated for > saml-schema-metadata-2.0.xsd for example I looked into PSVI today but could not find a way to determine if an element was matched by a wildcard. I am still going to ask on the Xerces-C++ mailing list. BTW, out of curiosity I checked how this is supported in other data binding tools. I particularly looking into XMLBeans and, guess what, it silently generates broken code. You may want to check your jaxb code -- I bet it is broken as well. 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/20061219/a62cbf56/attachment.pgp From boris at codesynthesis.com Wed Dec 20 06:18:13 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <4587BF68.7060406@intient.com> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> <4585D0C5.2030509@intient.com> <20061218094807.GD5816@karelia> <45867193.3030103@intient.com> <20061219094315.GA8415@karelia> <4587BF68.7060406@intient.com> Message-ID: <20061220111813.GE11409@karelia> Hi Bradley, I've CC'ed xsd-users to my reply; some of the information below could be useful to others. Bradley Beddoes writes: > Linux 64bit Fedora and 32bit Fedora is the development environment which > would be good for now, further down the track we will need a larger > range of OS's perhaps (Windows/OSX). The fix will be part of the upcoming (beginning of Jan) 2.3.1 and thus supported on all platforms. What is the platform you are using for code generation right now? > >I looked into PSVI today but could not find a way to determine if an > >element was matched by a wildcard. I am still going to ask on the > >Xerces-C++ mailing list. > > I will be interested to know the outcome of this for my own work with > xerces actually. I sent an email to the Xerces-C++ mailing list but there is no reply yet. I am, however, pretty sure there is no way to obtain the necessary information based on my studying of how things work. I am going to change the error to a warning for now. > >BTW, out of curiosity I checked how this is supported in other data > >binding tools. I particularly looking into XMLBeans and, guess what, > >it silently generates broken code. > > Broken how? Here is a simple test schema: XMLBeans generates a number of functions for each element, one of which is isSetFoo. Here is its implementation: public boolean isSetFoo() { synchronized (monitor()) { check_orphaned(); return get_store().count_elements(FOO$0) != 0; } } Where FOO$0 is a QName for the "foo" element. Now imagine an instance which omits the first "foo" element but has "foo" in place of the wildcard. > The JAXB bindings generator actually creates a member variable of type > org.w3c.dom.Element which you can see in the attached source code. I think you forgot to attach the code. Hopefully the example with XMLBeans will help you check whether JAXB can handle this properly. If it does, then it would be interesting to know how. > This > obviously means that you need to create a second JAXB unmarshaller > instance to deal with the types of element you reasonably expect to > receive as the any element in your instance documents. We have had the > same situation elsewhere with JAXB handling the any type however and it > does not pose to much of an issue. You can do the same in XSD with the DOM association feature. If you pass the keep_dom flag to one of the parsing function, then you can obtain the corresponding DOM node for any C++/Tree node and use that to parse things further. 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/20061220/d2af10d2/attachment.pgp From beddoes at intient.com Wed Dec 20 06:50:30 2006 From: beddoes at intient.com (Bradley Beddoes) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <20061220111813.GE11409@karelia> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> <4585D0C5.2030509@intient.com> <20061218094807.GD5816@karelia> <45867193.3030103@intient.com> <20061219094315.GA8415@karelia> <4587BF68.7060406@intient.com> <20061220111813.GE11409@karelia> Message-ID: <45892386.4050405@intient.com> Hi Boris, Boris Kolpackov wrote: > Hi Bradley, > > I've CC'ed xsd-users to my reply; some of the information below > could be useful to others. > > Bradley Beddoes writes: > >> Linux 64bit Fedora and 32bit Fedora is the development environment which >> would be good for now, further down the track we will need a larger >> range of OS's perhaps (Windows/OSX). > > The fix will be part of the upcoming (beginning of Jan) 2.3.1 and thus > supported on all platforms. What is the platform you are using for > code generation right now? > Linux 32bit is all I need for the immediate future to continue dev work on this side. > >>> I looked into PSVI today but could not find a way to determine if an >>> element was matched by a wildcard. I am still going to ask on the >>> Xerces-C++ mailing list. >> I will be interested to know the outcome of this for my own work with >> xerces actually. > > I sent an email to the Xerces-C++ mailing list but there is no reply > yet. I am, however, pretty sure there is no way to obtain the > necessary information based on my studying of how things work. I am > going to change the error to a warning for now. > > >>> BTW, out of curiosity I checked how this is supported in other data >>> binding tools. I particularly looking into XMLBeans and, guess what, >>> it silently generates broken code. >> Broken how? > > Here is a simple test schema: > > > > > > > > > > > > > > > XMLBeans generates a number of functions for each element, one of which is > isSetFoo. Here is its implementation: > > public boolean isSetFoo() > { > synchronized (monitor()) > { > check_orphaned(); > return get_store().count_elements(FOO$0) != 0; > } > } > > Where FOO$0 is a QName for the "foo" element. Now imagine an instance > which omits the first "foo" element but has "foo" in place of the > wildcard. I assume you mean the exact same foo (ns/type etc) element here, I would actually expect the above to return true, from an instance document is it ever important if the element is meant to map to the explict definition or the any statement in the schema? probably not... all you want to know is that it is there for consumption in your app. > > > >> The JAXB bindings generator actually creates a member variable of type >> org.w3c.dom.Element which you can see in the attached source code. > > I think you forgot to attach the code. Hopefully the example with > XMLBeans will help you check whether JAXB can handle this properly. > If it does, then it would be interesting to know how. > Not sure what is going on with my mail client lately it seems to be broken with attachments at times, anyways assuming this attachment works you can see how the ArtifactResponse and StatusResponseTypes are generated. I would have to test how your case above would work out but my theory is that JAXB would always unmarshall an instance document with a single "foo" element as being the value of set/get foo (as it should), with subsequent foo elements which are substituted for ##any being stored at as set/get any > >> This >> obviously means that you need to create a second JAXB unmarshaller >> instance to deal with the types of element you reasonably expect to >> receive as the any element in your instance documents. We have had the >> same situation elsewhere with JAXB handling the any type however and it >> does not pose to much of an issue. > > You can do the same in XSD with the DOM association feature. If you pass > the keep_dom flag to one of the parsing function, then you can obtain > the corresponding DOM node for any C++/Tree node and use that to parse > things further. Good to know that similar functionality exists in XSD. > > > hth, > -boris -- Bradley Beddoes Lead Software Architect Intient - "Open Source, Open Standards" -------------- next part -------------- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b01-EA1 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2006.12.20 at 09:39:30 AM EST // package com.qut.middleware.saml2.schemas.protocol; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; /** *

Java class for ArtifactResponseType complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="ArtifactResponseType">
 *   <complexContent>
 *     <extension base="{urn:oasis:names:tc:SAML:2.0:protocol}StatusResponseType">
 *       <sequence>
 *         <any/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ArtifactResponseType", propOrder = { "any" }) @XmlRootElement(name = "ArtifactResponse") public class ArtifactResponse extends StatusResponseType { @XmlAnyElement protected Element any; /** * Gets the value of the any property. * * @return * possible object is * {@link Element } * */ public Element getAny() { return any; } /** * Sets the value of the any property. * * @param value * allowed object is * {@link Element } * */ public void setAny(Element value) { this.any = value; } } -------------- next part -------------- // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b01-EA1 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2006.12.20 at 09:39:30 AM EST // package com.qut.middleware.saml2.schemas.protocol; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.datatype.XMLGregorianCalendar; import com.qut.middleware.saml2.schemas.assertion.NameIDType; import com.qut.middleware.saml2.schemas.esoe.protocol.ClearAuthzCacheResponse; import com.qut.middleware.saml2.schemas.esoe.protocol.ValidateInitializationResponse; import org.w3._2000._09.xmldsig_.Signature; /** *

Java class for StatusResponseType complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="StatusResponseType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{urn:oasis:names:tc:SAML:2.0:assertion}Issuer" minOccurs="0"/>
 *         <element ref="{http://www.w3.org/2000/09/xmldsig#}Signature" minOccurs="0"/>
 *         <element ref="{urn:oasis:names:tc:SAML:2.0:protocol}Extensions" minOccurs="0"/>
 *         <element ref="{urn:oasis:names:tc:SAML:2.0:protocol}Status"/>
 *       </sequence>
 *       <attribute name="Consent" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
 *       <attribute name="Destination" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
 *       <attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
 *       <attribute name="InResponseTo" type="{http://www.w3.org/2001/XMLSchema}NCName" />
 *       <attribute name="IssueInstant" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
 *       <attribute name="Version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "StatusResponseType", propOrder = { "issuer", "signature", "extensions", "status" }) @XmlSeeAlso({ ValidateInitializationResponse.class, ClearAuthzCacheResponse.class, NameIDMappingResponse.class, Response.class, ArtifactResponse.class }) public class StatusResponseType { @XmlElement(name = "Issuer", namespace = "urn:oasis:names:tc:SAML:2.0:assertion") protected NameIDType issuer; @XmlElement(name = "Signature", namespace = "http://www.w3.org/2000/09/xmldsig#") protected Signature signature; @XmlElement(name = "Extensions") protected Extensions extensions; @XmlElement(name = "Status", required = true) protected Status status; @XmlAttribute(name = "Consent") @XmlSchemaType(name = "anyURI") protected String consent; @XmlAttribute(name = "Destination") @XmlSchemaType(name = "anyURI") protected String destination; @XmlAttribute(name = "ID", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; @XmlAttribute(name = "InResponseTo") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NCName") protected String inResponseTo; @XmlAttribute(name = "IssueInstant", required = true) protected XMLGregorianCalendar issueInstant; @XmlAttribute(name = "Version", required = true) protected String version; /** * Gets the value of the issuer property. * * @return * possible object is * {@link NameIDType } * */ public NameIDType getIssuer() { return issuer; } /** * Sets the value of the issuer property. * * @param value * allowed object is * {@link NameIDType } * */ public void setIssuer(NameIDType value) { this.issuer = value; } /** * Gets the value of the signature property. * * @return * possible object is * {@link Signature } * */ public Signature getSignature() { return signature; } /** * Sets the value of the signature property. * * @param value * allowed object is * {@link Signature } * */ public void setSignature(Signature value) { this.signature = value; } /** * Gets the value of the extensions property. * * @return * possible object is * {@link Extensions } * */ public Extensions getExtensions() { return extensions; } /** * Sets the value of the extensions property. * * @param value * allowed object is * {@link Extensions } * */ public void setExtensions(Extensions value) { this.extensions = value; } /** * Gets the value of the status property. * * @return * possible object is * {@link Status } * */ public Status getStatus() { return status; } /** * Sets the value of the status property. * * @param value * allowed object is * {@link Status } * */ public void setStatus(Status value) { this.status = value; } /** * Gets the value of the consent property. * * @return * possible object is * {@link String } * */ public String getConsent() { return consent; } /** * Sets the value of the consent property. * * @param value * allowed object is * {@link String } * */ public void setConsent(String value) { this.consent = value; } /** * Gets the value of the destination property. * * @return * possible object is * {@link String } * */ public String getDestination() { return destination; } /** * Sets the value of the destination property. * * @param value * allowed object is * {@link String } * */ public void setDestination(String value) { this.destination = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getID() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setID(String value) { this.id = value; } /** * Gets the value of the inResponseTo property. * * @return * possible object is * {@link String } * */ public String getInResponseTo() { return inResponseTo; } /** * Sets the value of the inResponseTo property. * * @param value * allowed object is * {@link String } * */ public void setInResponseTo(String value) { this.inResponseTo = value; } /** * Gets the value of the issueInstant property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getIssueInstant() { return issueInstant; } /** * Sets the value of the issueInstant property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setIssueInstant(XMLGregorianCalendar value) { this.issueInstant = value; } /** * Gets the value of the version property. * * @return * possible object is * {@link String } * */ public String getVersion() { return version; } /** * Sets the value of the version property. * * @param value * allowed object is * {@link String } * */ public void setVersion(String value) { this.version = value; } } From beddoes at intient.com Wed Dec 20 07:01:19 2006 From: beddoes at intient.com (Bradley Beddoes) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <45892386.4050405@intient.com> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> <4585D0C5.2030509@intient.com> <20061218094807.GD5816@karelia> <45867193.3030103@intient.com> <20061219094315.GA8415@karelia> <4587BF68.7060406@intient.com> <20061220111813.GE11409@karelia> <45892386.4050405@intient.com> Message-ID: <4589260F.2030507@intient.com> Hi, > > I assume you mean the exact same foo (ns/type etc) element here, I would > actually expect the above to return true, from an instance document is > it ever important if the element is meant to map to the explict > definition or the any statement in the schema? probably not... all you > want to know is that it is there for consumption in your app. Forget that its late here and I have been writing code for about 16 hours now I should have thought about what I was saying for 2 seconds longer before posting, naturally with a sequence its going to matter. >> >>> The JAXB bindings generator actually creates a member variable of type >>> org.w3c.dom.Element which you can see in the attached source code. >> >> I think you forgot to attach the code. Hopefully the example with >> XMLBeans will help you check whether JAXB can handle this properly. >> If it does, then it would be interesting to know how. >> > > Not sure what is going on with my mail client lately it seems to be > broken with attachments at times, anyways assuming this attachment works > you can see how the ArtifactResponse and StatusResponseTypes are > generated. I would have to test how your case above would work out but > my theory is that JAXB would always unmarshall an instance document with > a single "foo" element as being the value of set/get foo (as it should), > with subsequent foo elements which are substituted for ##any being > stored at as set/get any > Likewise this, I would need to actually do the test with for example an instance document that had the elements bar and foo defined in that order to see what results it gave, I will give that a go tomorrow morning when I wake up and let you know. Bradley -- Bradley Beddoes Lead Software Architect Intient - "Open Source, Open Standards" From david.r.moss at selex-comm.com Wed Dec 20 08:35:49 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] #include directives & relative paths In-Reply-To: <20061214143002.GA26166@karelia> Message-ID: Boris, That seems to do the trick nicely! 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 > -----Original Message----- > From: Boris Kolpackov [mailto:boris@codesynthesis.com] > Sent: 14 December 2006 14:30 > To: Moss, David R (SELEX Comms) (UK Christchurch) > Cc: xsd-users@codesynthesis.com > Subject: Re: [xsd-users] #include directives & relative paths > > Hi David, > > Moss, David R (SELEX Comms) (UK Christchurch) comm.com> writes: > > > A precompiled binary would be great, thanks for the swift reply. > > The binary is available at > > http://codesynthesis.com/~boris/tmp/xsd-2.3.1.b2-2-i686-windows.zip > > > The two new options are --include-regex and --include-regex-trace. With > the first one you can provide a regular expression that will be used > to transform #include paths. The second one is useful for debugging. > > For your case, I think, a regex like this should do the trick: > > #.+/([^/]+)#generated/$1# > > > Let me know if there are any problems. > > > -boris ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** From boris at codesynthesis.com Thu Dec 21 02:04:28 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] ##any type problems In-Reply-To: <4589260F.2030507@intient.com> References: <4580F3A2.2080102@intient.com> <20061214150219.GB26166@karelia> <4585D0C5.2030509@intient.com> <20061218094807.GD5816@karelia> <45867193.3030103@intient.com> <20061219094315.GA8415@karelia> <4587BF68.7060406@intient.com> <20061220111813.GE11409@karelia> <45892386.4050405@intient.com> <4589260F.2030507@intient.com> Message-ID: <20061221070428.GB17360@karelia> Hi Bradley, Bradley Beddoes writes: > >I assume you mean the exact same foo (ns/type etc) element here, I would > >actually expect the above to return true, from an instance document is > >it ever important if the element is meant to map to the explict > >definition or the any statement in the schema? probably not... all you > >want to know is that it is there for consumption in your app. > > Forget that its late here and I have been writing code for about 16 > hours now I should have thought about what I was saying for 2 seconds > longer before posting, naturally with a sequence its going to matter. It could also matter in other case, all depending on the application semantics. Even in your case, imagine the Signature element was allowed in the payload. I think you would want to distinguish the case where there is no "header" signature while payload itself is a signature and when there is a "header" signature. > >Not sure what is going on with my mail client lately it seems to be > >broken with attachments at times, anyways assuming this attachment works > >you can see how the ArtifactResponse and StatusResponseTypes are > >generated. I would have to test how your case above would work out but > >my theory is that JAXB would always unmarshall an instance document with > >a single "foo" element as being the value of set/get foo (as it should), > >with subsequent foo elements which are substituted for ##any being > >stored at as set/get any > > > > Likewise this, I would need to actually do the test with for example an > instance document that had the elements bar and foo defined in that > order to see what results it gave, I will give that a go tomorrow > morning when I wake up and let you know. To actually understand how JAXB associates things one will need to study the code that fills in all the fields. Or create a test, as you have suggested. 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/20061221/54db599a/attachment.pgp From david.r.moss at selex-comm.com Thu Dec 21 10:27:14 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Serialisation issue. In-Reply-To: Message-ID: Boris, Using xsd-2.3.1.b2-i686-windows, the attached xsd files are compiled with, among others: --generate-polymorphic --generate-serialization And this code: ************************************************ using namespace Base; // Load the file - ok. auto_ptr db( UserDatabase( "test-users.xml" ) ); // Write out data. xml_schema::namespace_infomap map; map["b"].name = "http://www.dave.com/Base"; map["b"].schema = "test-users.xsd"; // How do you set up a mapping for noNamespaceSchemaLocation? map[""].name = ""; map[""].schema = "derived-user-config.xsd"; UserDatabase( std::ofstream( "test-users.xml" ), *db, map ); // Exception ************************************************ An unhandled no_prefix() exception is thrown from template std::basic_string prefix (const std::basic_string& ns, const xercesc::DOMElement& e) in elements.txx. I think I'm missing something pretty obvious to do with noNamespaceSchemaLocation here, but any help would be appreciated. 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 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users.xsd Type: application/octet-stream Size: 777 bytes Desc: test-users.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061221/1279f9d6/test-users.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users.xml Type: text/xml Size: 462 bytes Desc: test-users.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061221/1279f9d6/test-users.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: derived-user-config.xsd Type: application/octet-stream Size: 744 bytes Desc: derived-user-config.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061221/1279f9d6/derived-user-config.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test-user-config.xsd Type: application/octet-stream Size: 595 bytes Desc: test-user-config.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061221/1279f9d6/test-user-config.obj From jnw at xs4all.nl Thu Dec 21 16:19:33 2006 From: jnw at xs4all.nl (Jeroen N. Witmond) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Attempting to access attribute xml:base. Message-ID: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> First of all, thanks for a great product. It really makes accessing XML from C++ much easier. Unfortunately, I'm having problems finding out how to access attributes with the xml prefix, specifically xml:base, from my application code. Nowhere in the documentation or the generated code can I find a way to do so. I tried using xsd cxx-tree --generate-xml-schema XmlSchema.xsd xsd cxx-tree --extern-xml-schema XmlSchema.xsd [other options] \ toaccess.xsd But this only resulted in the typedefs in namespace xml_schema being declared in file XmlSchema.hxx instead of in toaccess.hxx. On a related note: I came across an xsd file containing Processing this xsd file results in an error about a missing schemaLocation attribute. Specifying one (for instance http://www.w3.org/2001/XMLSchema.xsd as Google found) does not work. And I don't think downloading the schema for schemas (and all files it references) to a local disk and turning xsd loose on the result is a viable option. :-) Have I missed something? Or is this a known restriction? I have installed http://www.codesynthesis.com/download/xsd/2.3/linux-gnu/i686/xsd_2.3.0-1_i386.deb on 2006-12-12. Kind regards, Jeroen. From boris at codesynthesis.com Fri Dec 22 03:32:22 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Re: Serialisation issue. In-Reply-To: References: Message-ID: <20061222083222.GA20058@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > An unhandled no_prefix() exception is thrown from > > template > std::basic_string > prefix (const std::basic_string& ns, const xercesc::DOMElement& > e) > > in elements.txx. > > > I think I'm missing something pretty obvious to do with > noNamespaceSchemaLocation here, but any help would be appreciated. Your noNamespaceSchemaLocation setup is fine. This is a bug in XSD runtime, in the code that handles substitution groups. Your "derived" element does not have a namespace but the code tries to resolve the namespace prefix anyway. I've fixed this bug and the fix will appear in the upcoming release. You can also fix it in your version of XSD by replacing the files in libxsd with the revisions provide in this archive: http://codesynthesis.com/~boris/tmp/xsd-2.3.1.b2-no-ns-substgroup-patch.zip Thanks for reporting this and let me know if there any problems with the fix. 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/20061222/03433da5/attachment.pgp From boris at codesynthesis.com Fri Dec 22 04:35:48 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Attempting to access attribute xml:base. In-Reply-To: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> References: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> Message-ID: <20061222093548.GB20058@karelia> Hi Jeroen, Jeroen N. Witmond writes: > First of all, thanks for a great product. It really makes accessing > XML from C++ much easier. Thanks. We are glad you are enjoying it. > Unfortunately, I'm having problems finding out how to access > attributes with the xml prefix, specifically xml:base, from my > application code. Nowhere in the documentation or the generated code > can I find a way to do so. There is not much special about attributes from the XML namespace. They are defined in the following schema by W3C: http://www.w3.org/2001/xml.xsd If you want to allow one or more attributes from this schema in your type then you will first import the schema and then add a reference to the attributes you need, for example: You will need to compile both your schema and xml.xsd. In the generated code you will have a set of member functions to access the value of 'base'. The only special thing about the XML namespace is that you do not need to define a namespace-prefix mapping for the 'xml' prefix. If you want to allow say xml:base in all types in your schema then you may want to create a base type which includes only that attribute and then inherit all other types from it. > I tried using > > xsd cxx-tree --generate-xml-schema XmlSchema.xsd > xsd cxx-tree --extern-xml-schema XmlSchema.xsd [other options] \ > toaccess.xsd > > But this only resulted in the typedefs in namespace xml_schema being > declared in file XmlSchema.hxx instead of in toaccess.hxx. That's expected. These options are useful when you want to factor out those typedefs into a separate header because, for example, you want to customize XML Schema built-in types of you have a lot of schemas and want to reduce compilation time. > On a related note: I came across an xsd file containing > > > > Processing this xsd file results in an error about a missing > schemaLocation attribute. Specifying one (for instance > http://www.w3.org/2001/XMLSchema.xsd as Google found) does not work. Google made a mistake (is that at all possible? ;-)). The schema for the http://www.w3.org/XML/1998/namespace namespace is xml.xsd. > And I don't think downloading the schema for schemas (and all files it > references) to a local disk and turning xsd loose on the result is a > viable option. :-) It may sound strange (it sure did to me when I first found out) but Schema for XML Schema (XMLSchema.xsd) is not really a valid XML Schema definition. It is there for illustration purposes only. 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/20061222/154a9dd8/attachment.pgp From david.r.moss at selex-comm.com Fri Dec 22 05:13:12 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] RE: Serialisation issue. In-Reply-To: <20061222083222.GA20058@karelia> Message-ID: Boris, Thanks again for the quick response - that fixes the serialisation problem! However, trying to reload the generated xml file fails. It seems to depend on the order of the xsi:schemaLocation and xsi:noNamespaceSchemaLocation declarations. My original instance declared xsi:schemaLocation first and that loaded fine. The generated file swaps the order and that fails to load with "error: Unknown element 'b:UserDatabase'" (the root element). Manually swapping the order back confirms this. Nearly there! :-) I'm off on holiday now - Happy Christmas to everyone! 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 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** From boris at codesynthesis.com Fri Dec 22 05:13:08 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Re: Serialisation issue. In-Reply-To: References: <20061222083222.GA20058@karelia> Message-ID: <20061222101308.GC20058@karelia> Hi David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > However, trying to reload the generated xml file fails. It seems to > depend on the order of the xsi:schemaLocation and > xsi:noNamespaceSchemaLocation declarations. > > My original instance declared xsi:schemaLocation first and that loaded > fine. The generated file swaps the order and that fails to load with > "error: Unknown element 'b:UserDatabase'" (the root element). Manually > swapping the order back confirms this. Hm, the order definitely should not matter. I tried it and it works for me. Which version of Xerces-C++ are you using? I am using 2.7.0. > I'm off on holiday now - Happy Christmas to everyone! Happy holidays to you as well! Have a good time. -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/20061222/078d211c/attachment.pgp From david.r.moss at selex-comm.com Fri Dec 22 05:58:04 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] RE: Serialisation issue. In-Reply-To: <20061222101308.GC20058@karelia> Message-ID: Boris, I'm also using 2.7.0. With the attached files, test-users-2.xml doesn't load: // Loads. auto_ptr db( UserDatabase( "test-users.xml" ) ); // Exception thrown. auto_ptr db2( UserDatabase( "test-users-2.xml" ) ); (As an aside, the first shouldn't load either as Number should be unique. I'm assuming this is due to xpath="TestUserConfig" not allowing for substitution groups.) 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 > -----Original Message----- > From: Boris Kolpackov [mailto:boris@codesynthesis.com] > Sent: 22 December 2006 10:13 > To: Moss, David R (SELEX Comms) (UK Christchurch) > Cc: xsd-users@codesynthesis.com > Subject: Re: Serialisation issue. > > Hi David, > > Moss, David R (SELEX Comms) (UK Christchurch) comm.com> writes: > > > However, trying to reload the generated xml file fails. It seems to > > depend on the order of the xsi:schemaLocation and > > xsi:noNamespaceSchemaLocation declarations. > > > > My original instance declared xsi:schemaLocation first and that loaded > > fine. The generated file swaps the order and that fails to load with > > "error: Unknown element 'b:UserDatabase'" (the root element). Manually > > swapping the order back confirms this. > > Hm, the order definitely should not matter. I tried it and it works for > me. Which version of Xerces-C++ are you using? I am using 2.7.0. > > > > I'm off on holiday now - Happy Christmas to everyone! > > Happy holidays to you as well! Have a good time. > > > -boris ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users-2.xml Type: text/xml Size: 465 bytes Desc: test-users-2.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061222/5721573f/test-users-2.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: derived-user-config.xsd Type: application/octet-stream Size: 744 bytes Desc: derived-user-config.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061222/5721573f/derived-user-config.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test-user-config.xsd Type: application/octet-stream Size: 595 bytes Desc: test-user-config.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061222/5721573f/test-user-config.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users.xsd Type: application/octet-stream Size: 777 bytes Desc: test-users.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061222/5721573f/test-users.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test-users.xml Type: text/xml Size: 559 bytes Desc: test-users.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061222/5721573f/test-users.bin From merryla at gmail.com Fri Dec 29 04:13:49 2006 From: merryla at gmail.com (merryla martina) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Regarding XML schema validation (XSD) Message-ID: Hi, I tried to perform schema validation. The code works well. But when I tried with the Sample txlife.xsd file from http://acord.org/ I got error in associating the namespace with the xsd i.e. in the add () method. The add () method returned E_FALSE. When I referred the MSDN library, it states that "E_FAIL is returned if: ? The collection is read-only ? The document is not a recognized schema ? An error occurs when compiling the schema ? The ready state of the document is not 4. " After referring MSDN library, I tried to catch the error description. The error descriptions look like this Undeclared XSD type: '{http://ACORD.org/Standards/Life/2} ACORD_TYPE_CODE'. So I referred the txlife.xsd schema, I found that ACORD_TYPE_CODE was referred but not defined. After that I tried to view the site http://ACORD.org/Standards/Life/2 for the definition of ACORD_TYPE_CODE.I found "page not found " error. Here I can't understand why this error description, which is highted above, comes, as this xsd file is a standard one. The sample txlife.xsd file starts like this From boris at codesynthesis.com Fri Dec 29 05:15:23 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Regarding XML schema validation (XSD) In-Reply-To: References: Message-ID: <20061229101523.GA12248@karelia> Hi Merryla, This mailing list is about CodeSynthesis XSD[1], an XML Schema to C++ data binding compiler. For general questions about XML Schema I suggest that you try the xmlschema-dev[2] mailing list. For Microsoft-specific questions you can try their XML news group. [1] http://www.codesynthesis.com/products/xsd/ [2] http://lists.w3.org/Archives/Public/xmlschema-dev/ 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/20061229/d8b523d4/attachment.pgp From jnw at xs4all.nl Fri Dec 29 12:14:22 2006 From: jnw at xs4all.nl (Jeroen N. Witmond) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Attempting to access attribute xml:base. In-Reply-To: <20061222093548.GB20058@karelia> References: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> <20061222093548.GB20058@karelia> Message-ID: <19842.194.109.230.85.1167412462.squirrel@webmail.xs4all.nl> "Boris Kolpackov" writes: [snipped explanation about access to xml:base] Thanks, I've got this to work in a test program, but I'm confused about the code generated for xml.xsd. I used 'xsd cxx-tree --namespace-map http://www.w3.org/XML/1998/namespace=XmlNamespace xml.xsd' and see that the generated .cxx file does not contain any executable code, nor does the generated .hxx file declare anything in namespace XmlNamespace. Instead all code related to xml:base is in the files generated from my own .xsd file. > If you want to allow say xml:base in all types in your schema then > you may want to create a base type which includes only that attribute > and then inherit all other types from it. Unfortunately, I need to be able to access xml:base in code generated from schemas I do not author, where the use of xml:base is covered by a ''. So, instead of using a base type in XML, I would need a base class in C++. And unless I've missed something, there is no way to tell xsd to generate its classes ': public XmlNamespace' (for instance, where XmlNamespace is a class that implements access to xml:base.). [Snipped closed points.] Kind regards, Jeroen. From rschmilinsky at yahoo.ca Sat Dec 30 07:37:47 2006 From: rschmilinsky at yahoo.ca (Remsy Schmilinsky) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] non english characters Message-ID: <20061230123747.57216.qmail@web53913.mail.yahoo.com> Hi. I modifed hello.xml to test the parsing of strings containing accented characters however these strings are not being displayed when running driver.cxx. I'm using linux ubuntu "edgy". It works fine under cygwin. Furthermore, I have no problem printing accented characters to the console from a simple "hello world" c++ application (std::string). xsd uses UTF-8 by default too? Is there something I can do to fix it? thanks, Remsy __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From boris at codesynthesis.com Sat Dec 30 12:09:27 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] non english characters In-Reply-To: <20061230123747.57216.qmail@web53913.mail.yahoo.com> References: <20061230123747.57216.qmail@web53913.mail.yahoo.com> Message-ID: <20061230170927.GA15258@karelia> Hi Remsy, Remsy Schmilinsky writes: > Hi. I modifed hello.xml to test the parsing of strings containing > accented characters however these strings are not being displayed > when running driver.cxx. > > I'm using linux ubuntu "edgy". > > It works fine under cygwin. Furthermore, I have no problem printing > accented characters to the console from a simple "hello world" c++ > application (std::string). > > xsd uses UTF-8 by default too? Is there something I can do to fix it? For 8-bit characters (char), XSD uses current locale/code page for encoding. On POSIX systems you can set the locale with the setlocale function, as the following sample shows for UTF-8: #include #include int main () { if (!std::setlocale (LC_CTYPE, "en_US.UTF-8")) { std::cerr << "en_US.UTF-8 locale is not supported" << std::endl; return 1; } ... } The advantage of this approach lies in the fact that the same character encoding is now assumed by the resulting in-memory representation and the string/character manipulation functions provided by the language runtime. 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/20061230/407a1efd/attachment.pgp From boris at codesynthesis.com Sat Dec 30 12:52:34 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:51 2009 Subject: [xsd-users] Attempting to access attribute xml:base. In-Reply-To: <19842.194.109.230.85.1167412462.squirrel@webmail.xs4all.nl> References: <8644.194.109.230.85.1166735973.squirrel@webmail.xs4all.nl> <20061222093548.GB20058@karelia> <19842.194.109.230.85.1167412462.squirrel@webmail.xs4all.nl> Message-ID: <20061230175234.GB15258@karelia> Hi Jeroen, Jeroen N. Witmond writes: > Thanks, I've got this to work in a test program, but I'm confused about > the code generated for xml.xsd. I used 'xsd cxx-tree --namespace-map > http://www.w3.org/XML/1998/namespace=XmlNamespace xml.xsd' and see that > the generated .cxx file does not contain any executable code, nor does the > generated .hxx file declare anything in namespace XmlNamespace. Instead > all code related to xml:base is in the files generated from my own .xsd > file. xml.xsd defines four global attributes and an attribute group. Those are meant to be used via the ref="" attribute. As a result, there is nothing being generated for these constructs where they are defined (xml.xsd), only where they are used (your schema). XSD does not (yet) analyze the schema to detect such a (presumably rare) case where there is nothing useful being generated. So you still need to translate xml.xsd since there will be #include "xml.hxx" directives present in the code generated from your schema. > > If you want to allow say xml:base in all types in your schema then > > you may want to create a base type which includes only that attribute > > and then inherit all other types from it. > > Unfortunately, I need to be able to access xml:base in code generated from > schemas I do not author, where the use of xml:base is covered by a > ''. So, instead of using a base > type in XML, I would need a base class in C++. And unless I've missed > something, there is no way to tell xsd to generate its classes ': public > XmlNamespace' (for instance, where XmlNamespace is a class that implements > access to xml:base.). There are a number of ways you can implement this (in the order of increasing sophistication): 1. Use DOM association. You can pass the xml_schema::flags::keep_dom flag to one of the parsing functions which will result in the DOM nodes corresponding to the tree nodes being accessible via the _node() function. See Section 3.2, "Flags and Properties" of the C++/Tree Mapping Manual[1] as well as 'mixed' example for more information. Using the DOM API you can check for presence of the xml:base attribute. 2. You can do pretty much what you've described above by customizing the types that have and check/extract the xml:base attribute in the constructor. See the C++/Tree Mapping Customization Guide[2] as well as the examples in the custom/ directory for details. 3. This is a variation of (2), for cases where you have a lot of unrelated types that all allow for . In this case you may want to customize the xml_schema::type class which corresponds to XML Schema anyType and is a base for every generated types. You can customize xml_schema::type by inheriting from the original and checking for xml::base in the constructor. Again, see the C++/Tree Mapping Customization Guide[2] and examples for details. [1] http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#3.2 [2] http://wiki.codesynthesis.com/Tree/Customization_guide 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/20061230/a1709c5a/attachment.pgp