From boris at codesynthesis.com Tue Jan 3 05:42:08 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] plans for xsd 1.8.0 Message-ID: <20060103104208.GA31607@karelia> Good day, We are planning to make the following user-visible changes in xsd 1.8.0 which is to be released around Jan 16. Your feedback on the proposed changes/new features is always appreciated. * Support for new C++ compilers: Microsoft Visual C++ 8 (Visual Studio 2005) and Sun C++ 5.8 (Studio 11). cxx-tree * Support for default and fixed values in attributes. An optional attribute with a default or fixed value will be mapped to the One cardinality class instead of the Optional cardinality class. cxx-parser * Support for Expat as an underlying XML parser in addition to Xerces-C++. This will allow one to use the C++/Parser mapping in memory-constrained environments such as embedded systems. * New error handling mechanism (similar to the one added to the C++/Tree mapping in version 1.7.0). Major changes will include generic error_handler interface in addition to native xercesc::ErrorHandler and propagation of parsing errors via C++ exceptions rather than printing to STDERR. 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/20060103/9f23b60f/attachment.pgp From mark_barnes at playstation.sony.com Tue Jan 3 14:23:53 2006 From: mark_barnes at playstation.sony.com (mark_barnes@playstation.sony.com) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Parsing the Collada 1.3.1 XSD Message-ID: <1136316233.3994.58.camel@debian> On Sat Dec 3 16:41:46 EST 2005, Boris wrote: > After fixing this bug I could compile the schema though there was > one more problem. Here is the relevant fragment (line 870): > > > > > > > > > ... > > > > As you can see, there are two definitions of the 'source' element. > I am not sure if this is intentional or a typo. It was intentional... in order to tighten the schema a little bit in that minor release while remaining compatible with existing documents. > BTW, the schema uses a lot of anonymous types and is > heavily recursive so to avoid code bloat I used --morph-anonymous > options: Are you suggesting that there are some improvements to the schema that could be made to make it easier for tools to parse it and generate code? I'm interested to hear your feedback on this. Regards, Marcus -- Mark Barnes COLLADA Project Lead, tel:+1.650.655.7342 Sony Computer Entertainment America http://research.scea.com From boris at codesynthesis.com Wed Jan 4 04:24:14 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Parsing the Collada 1.3.1 XSD In-Reply-To: <1136316233.3994.58.camel@debian> References: <1136316233.3994.58.camel@debian> Message-ID: <20060104092414.GA4273@karelia> Marcus, mark_barnes@playstation.sony.com writes: > On Sat Dec 3 16:41:46 EST 2005, Boris wrote: > > > > > > > > > > > > > > > > > > ... > > > > > > > > As you can see, there are two definitions of the 'source' element. > > I am not sure if this is intentional or a typo. > > It was intentional... in order to tighten the schema a little bit in > that minor release while remaining compatible with existing documents. I see. This complicates code generation because the second 'source' element needs to be renamed. It also makes the generated code uglier: nobody likes function names like 'source1'. > > BTW, the schema uses a lot of anonymous types and is > > heavily recursive so to avoid code bloat I used --morph-anonymous > > options: > > Are you suggesting that there are some improvements to the schema that > could be made to make it easier for tools to parse it and generate code? It is not so much about making tool developer's life easier but rather about the quality of the generated code. There is a number of XML Schema constructs that do not have straightforward mapping to most programming languages. Anonymous types are a very common example. While C++ supports anonymous types, it is too limited to be used for anything non-trivial (for example, an unnamed class cannot define any constructors). So in order to map anonymous XML Schema types to C++ classes the translator needs to come up with some names for those types. xsd provides two way of handling anonymous types. The first is to automatically name all anonymous types as if they were defined under xsd:schema element. The names for such types are derived from element/attribute names under which they were originally defined. While this approach works rather well in most cases, there are possibilities of "unstable name conflicts" when a schema includes or imports some other schemas. In this case the user will have to manually resolve such conflicts using command line options. This approach works quite well for your schema. The second approach translates anonymous types to nested C++ classes. This, however, may result in several copies of the same class being generated at different levels which, in turn, results in code bloat (xsd issues warnings when this happens). This approach does not work very well for your schema. As you can see, neither of the two solutions can compete with explicitly named XML Schema types. We have written "XML Schema Authoring Guide" which lists a number of XML Schema constructs that do not map "cleanly" to C++ (and most other programming languages). It is available here: http://codesynthesis.com/projects/xsd/documentation/schema-authoring-guide.xhtml 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/20060104/771935a5/attachment.pgp From efdegroot at corp.csnet.nl Wed Jan 4 10:00:37 2006 From: efdegroot at corp.csnet.nl (Eelko de Groot) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Question about base64-binary types Message-ID: <43BBE315.9010700@corp.csnet.nl> In the XSD I have an element of type base64Binary: The xsd tool compiles this to: namespace xml_schema { ... typedef ::xsd::cxx::tree::base64_binary_template< char > base64_binary; ... } class MessageDataType : public ::xsd::cxx::tree::type { public: ... // BinaryData // public: struct _xsd_BinaryData { typedef ::xml_schema::base64_binary type_; typedef ::xsd::cxx::tree::traits< type_ > traits_; }; public: struct BinaryData { typedef _xsd_BinaryData::type_ type; }; _xsd_BinaryData::type_ const& BinaryData () const; _xsd_BinaryData::type_& BinaryData (); void BinaryData (_xsd_BinaryData::type_ const&); void BinaryData (::std::auto_ptr< _xsd_BinaryData::type_ >); ... }; When I assign a string to the BinaryData member and after that I serialize the object I expect the library to encode my string to base64 encoding. Unfortunately this does not happen. my code: ... std::string data("hello"); MessageDataType msg(data); MessageData(std::cout, ..., ...); ... How can I let the library to encode/decode the base64Binary elements? Or should I use my own base64 encoder/decoder? Eelko From boris at codesynthesis.com Wed Jan 4 10:22:33 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Question about base64-binary types In-Reply-To: <43BBE315.9010700@corp.csnet.nl> References: <43BBE315.9010700@corp.csnet.nl> Message-ID: <20060104152233.GA5446@karelia> Eelko, Eelko de Groot writes: > How can I let the library to encode/decode the base64Binary elements? Or > should I use my own base64 encoder/decoder? At the moment we map base64Binary and hexBinary to strings. We neither decode nor encode the date stored in such strings. We didn't implement better support for binary data because there wasn't any interest in such a feature. I guess now there is ;-). If you would like I can implement proper binary support with encoding/ decoding and send it to you. This shouldn't take longer than a day. 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/20060104/3b2b5e2f/attachment.pgp From efdegroot at corp.csnet.nl Wed Jan 4 10:51:54 2006 From: efdegroot at corp.csnet.nl (Eelko de Groot) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Question about base64-binary types In-Reply-To: <20060104152233.GA5446@karelia> References: <43BBE315.9010700@corp.csnet.nl> <20060104152233.GA5446@karelia> Message-ID: <43BBEF1A.4030504@corp.csnet.nl> Boris, That would be very nice. Thank you. Eelko Boris Kolpackov schreef: > Eelko, > > Eelko de Groot writes: > > >>How can I let the library to encode/decode the base64Binary elements? Or >>should I use my own base64 encoder/decoder? > > > At the moment we map base64Binary and hexBinary to strings. We neither > decode nor encode the date stored in such strings. We didn't implement > better support for binary data because there wasn't any interest in > such a feature. I guess now there is ;-). > > If you would like I can implement proper binary support with encoding/ > decoding and send it to you. This shouldn't take longer than a day. > > hth, > -boris From mark_barnes at playstation.sony.com Wed Jan 4 21:34:58 2006 From: mark_barnes at playstation.sony.com (mark_barnes@playstation.sony.com) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Parsing the Collada 1.3.1 XSD In-Reply-To: <20060104092414.GA4273@karelia> References: <1136316233.3994.58.camel@debian> <20060104092414.GA4273@karelia> Message-ID: <1136428498.3994.398.camel@debian> On Wed, 2006-01-04 at 11:24 +0200, Boris Kolpackov wrote: > I see. This complicates code generation because the second 'source' > element needs to be renamed. It also makes the generated code uglier: > nobody likes function names like 'source1'. Yeah. It's gone in COLLADA 1.4.0. We've tightened up the sequencing alot and eleminated most unordered choice groups. > > > BTW, the schema uses a lot of anonymous types and is > > > heavily recursive so to avoid code bloat I used --morph-anonymous > > > options: > > > > Are you suggesting that there are some improvements to the schema that > > could be made to make it easier for tools to parse it and generate code? > > It is not so much about making tool developer's life easier but > rather about the quality of the generated code. There is a number > of XML Schema constructs that do not have straightforward mapping > to most programming languages. Anonymous types are a very common > example. While C++ supports anonymous types, it is too limited to > be used for anything non-trivial (for example, an unnamed class > cannot define any constructors). So in order to map anonymous XML > Schema types to C++ classes the translator needs to come up with > some names for those types. Right, I see. I think we have named a lot more of the types in COLLADA 1.4 and created many abstract base types and substitution groups as well. I'm not sure if inline use of complexType, group, and sequence counts towards anonymous types or not though. We still do that in places. > xsd provides two way of handling anonymous types. The first is to > automatically name all anonymous types as if they were defined > under xsd:schema element. The names for such types are derived > from element/attribute names under which they were originally > defined. While this approach works rather well in most cases, there > are possibilities of "unstable name conflicts" when a schema includes > or imports some other schemas. In this case the user will have to > manually resolve such conflicts using command line options. This > approach works quite well for your schema. I'm glad you have a workaround. If you want to propose a particular approach to the COLLADA schema elements I'm open to hear it. We use code generation too and favor that approach so ideas that make that work better are welcome! > The second approach translates anonymous types to nested C++ classes. This is what we having be favoring ourselves. > This, however, may result in several copies of the same class being > generated at different levels which, in turn, results in code bloat > (xsd issues warnings when this happens). This approach does not work > very well for your schema. We used nested elements alot more in COLLADA 1.4. It seemed a natural approach to limit the vocabulary of the schema while specializing the elements based on their context. C++ supports this with nested classes and yet I do see how this can be code bloat not unlike using templates. But I don't view it as bloat exactly since is a different class then for example. > As you can see, neither of the two solutions can compete with explicitly > named XML Schema types. Well we can named all our types and still used nested classes in the design. So perhaps there is a middle ground on this? To limit bloat you really have to limit the unique types of elements in the schema. In COLLADA 1.4 we have gone towards more strongly-typed elements and more of them because we want to leverage schema validation a great deal. > We have written "XML Schema Authoring Guide" which lists a number > of XML Schema constructs that do not map "cleanly" to C++ (and most > other programming languages). It is available here: > > http://codesynthesis.com/projects/xsd/documentation/schema-authoring-guide.xhtml Thanks I'll take a look at it. I think I read parts of it before as we were desiging COLLADA 1.4. Perhaps we have applied some of the lessons :) Regards, Marcus -- Mark Barnes COLLADA Project Lead, tel:+1.650.655.7342 Sony Computer Entertainment America http://research.scea.com From efdegroot at corp.csnet.nl Thu Jan 5 05:06:18 2006 From: efdegroot at corp.csnet.nl (Eelko de Groot) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] bug (?) with choice of two sequences with same element Message-ID: <43BCEF9A.6080000@corp.csnet.nl> When a schema contains a choice of two sequences of elements and both sequences contain the same element, the xsd tool produces two classes/structs with the same name. The following example illustrates this problem. Is there a solution for this? $ cat test.xsd $ $ xsd cxx-tree --generate-inline test.xsd $ cat test.hxx ... namespace test { class TestChoiceType : public ::xsd::cxx::tree::type { public: ... // ElementB1 // public: struct _xsd_ElementB1 { typedef ::xml_schema::string type_; typedef ::xsd::cxx::tree::traits< type_ > traits_; typedef ::xsd::cxx::tree::optional< type_ > container_; }; public: struct ElementB1 { typedef _xsd_ElementB1::type_ type; typedef _xsd_ElementB1::container_ container; }; _xsd_ElementB1::container_ const& ElementB1 () const; _xsd_ElementB1::container_& ElementB1 (); void ElementB1 (_xsd_ElementB1::type_ const&); void ElementB1 (_xsd_ElementB1::container_ const&); void ElementB1 (::std::auto_ptr< _xsd_ElementB1::type_ >); // ElementB1 // public: struct _xsd_ElementB1 { typedef ::xml_schema::string type_; typedef ::xsd::cxx::tree::traits< type_ > traits_; typedef ::xsd::cxx::tree::optional< type_ > container_; }; public: struct ElementB1 { typedef _xsd_ElementB1::type_ type; typedef _xsd_ElementB1::container_ container; }; _xsd_ElementB1::container_ const& ElementB1 () const; _xsd_ElementB1::container_& ElementB1 (); void ElementB1 (_xsd_ElementB1::type_ const&); void ElementB1 (_xsd_ElementB1::container_ const&); void ElementB1 (::std::auto_ptr< _xsd_ElementB1::type_ >); // Constructors. // public: TestChoiceType (); ... From boris at codesynthesis.com Thu Jan 5 07:44:18 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] bug (?) with choice of two sequences with same element In-Reply-To: <43BCEF9A.6080000@corp.csnet.nl> References: <43BCEF9A.6080000@corp.csnet.nl> Message-ID: <20060105124418.GA14968@karelia> Eelko, Eelko de Groot writes: > When a schema contains a choice of two sequences of elements and both > sequences contain the same element, the xsd tool produces two > classes/structs with the same name. Yes, this is not supported yet. But even when it is supported, it won't be pretty; the second element will be renamed to something like ElementB1. > Is there a solution for this? While your schema is legal per the spec, using the same element name more than once in a single type definition is not generally considered a very good idea. I personally haven't seen a single instance of such design where it would make sense. I would therefore suggest that you use some other name for the second element. If you absolutely must use the same name, you can create a "relaxed" copy of your schema and use it for code generation (while using the original schema for validation, if any), e.g.: 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/20060105/47be1e27/attachment.pgp From boris at codesynthesis.com Thu Jan 5 13:04:36 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Parsing the Collada 1.3.1 XSD In-Reply-To: <1136428498.3994.398.camel@debian> References: <1136316233.3994.58.camel@debian> <20060104092414.GA4273@karelia> <1136428498.3994.398.camel@debian> Message-ID: <20060105180436.GA18065@karelia> Marcus, mark_barnes@playstation.sony.com writes: > I'm not sure if inline use of complexType, group, and sequence counts > towards anonymous types or not though. We still do that in places. Only and definitions without the 'name' attribute result in anonymous types. > I'm glad you have a workaround. If you want to propose a particular > approach to the COLLADA schema elements I'm open to hear it. We use code > generation too and favor that approach so ideas that make that work > better are welcome! I tried to find COLLADA schema 1.4 but all I can get is 1.3.1. I could run xsd on it see if there are any warnings wrt anonymous types and code bloat. > > This, however, may result in several copies of the same class being > > generated at different levels which, in turn, results in code bloat > > (xsd issues warnings when this happens). This approach does not work > > very well for your schema. > > We used nested elements alot more in COLLADA 1.4. It seemed a natural > approach to limit the vocabulary of the schema while specializing the > elements based on their context. C++ supports this with nested classes > and yet I do see how this can be code bloat not unlike using templates. > But I don't view it as bloat exactly since is > a different class then for example. Right, if technique_common inside camera is of a completely different type compared to technique_common inside light, there is no code bloat. Nothing significant will be achieved if those types are explicitly named. However, if you have a schema like this: ... Then Camera and Light types will each have its own copy of the technique_common type. Those copies will be identical and can be replaced with one global type: ... Now both Camera and Light will use the same global TechniqueCommon type. > Well we can named all our types and still used nested classes in the > design. So perhaps there is a middle ground on this? You probably mean nested elements here? You can use nested elements regardless of whether you name your types or not. In fact, any schema with anonymous types can be transformed to an equivalent schema (from the validation point of view) that does not use any anonymous types. 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/20060105/1f0cc4d6/attachment.pgp From yacoub at amazon.com Thu Jan 5 23:20:27 2006 From: yacoub at amazon.com (Yacoub, Sherif) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Creating an XML without parsing an existing one Message-ID: <0606F82977C9A847B4FD9A8BDEC19DE02580A6@exchg-sea3-01.ant.amazon.com> Hi, I am new to the xsd tool and I was able to compile, generate, and parse XMLs. However, I have a question about the creation of an XML from scratch i.e. I don't have an XML and I want my program to create it. Using the library example in the distribution, what will be the constructor to use to create an instance of the "catalog" root node for example? Thanks for your help. Sherif -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060105/60340216/attachment.htm From mark_barnes at playstation.sony.com Thu Jan 5 14:15:42 2006 From: mark_barnes at playstation.sony.com (mark_barnes@playstation.sony.com) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Parsing the Collada 1.3.1 XSD In-Reply-To: <20060105180436.GA18065@karelia> References: <1136316233.3994.58.camel@debian> <20060104092414.GA4273@karelia> <1136428498.3994.398.camel@debian> <20060105180436.GA18065@karelia> Message-ID: <1136488542.3994.421.camel@debian> On Thu, 2006-01-05 at 20:04 +0200, Boris Kolpackov wrote: > Marcus writes: > > > I tried to find COLLADA schema 1.4 but all I can get is 1.3.1. I could > run xsd on it see if there are any warnings wrt anonymous types and code > bloat. The 1.4 schema will be released today I expect. It'll be at khronos.org. > Right, if technique_common inside camera is of a completely different > type compared to technique_common inside light, there is no code bloat. > Nothing significant will be achieved if those types are explicitly named. > However, if you have a schema like this: > > > > > ... > > > > > > > > > > > > > > > > > > > Then Camera and Light types will each have its own copy of the > technique_common type. Those copies will be identical and can > be replaced with one global type: Sure and we do that more in the 1.4 schema. The schema is quite a bit bigger then 1.3.1 was since we added FX and PhX features. Regards, Marcus -- Mark Barnes COLLADA Project Lead, tel:+1.650.655.7342 Sony Computer Entertainment America http://research.scea.com From boris at codesynthesis.com Fri Jan 6 04:41:25 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Creating an XML without parsing an existing one In-Reply-To: <0606F82977C9A847B4FD9A8BDEC19DE02580A6@exchg-sea3-01.ant.amazon.com> References: <0606F82977C9A847B4FD9A8BDEC19DE02580A6@exchg-sea3-01.ant.amazon.com> Message-ID: <20060106094125.GB25011@karelia> Sherif, Yacoub, Sherif writes: > However, I have a question about the creation of an XML from scratch > i.e. I don't have an XML and I want my program to create it. > > Using the library example in the distribution, what will be the > constructor to use to create an instance of the "catalog" root node > for example? Citing Section 2.7, "Mapping for Complex Types" from the manual: http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.7 "Additionally, the resulting C++ class defines a public constructor that takes an initializer for each member of the complex type and all its base types that belongs to the One cardinality class." Looking at the catalog type definition we conclude that the constructor won't have any arguments since the only member of this type (element book) belongs to the Sequence cardinality class (maxOccurs="unbounded"). Here is a code snippet that constructs a simple catalog from scratch: using namespace library; class catalog cat; { book b (201700735, // ISBN title ("The C++ Programming Language"), // Title genre::philosophy, // Genre "CXXPL"); // ID b.author ().push_back (author ("Bjarne Stroustrup", "1950-03-31")); cat.book ().push_back (b); } { book b (20170434, // ISBN title ("More Exceptional C++"), // Title genre::fiction, // Genre "MECXX"); // ID author a ("Herb Sutter", "1960-03-31"); a.recommends ("CXXPL"); b.author ().push_back (a); cat.book ().push_back (b); } // The cat object now contains two books. 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/20060106/864c60e6/attachment.pgp From yacoub at amazon.com Fri Jan 6 15:47:52 2006 From: yacoub at amazon.com (Yacoub, Sherif) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Creating an XML without parsing an existing one Message-ID: <0606F82977C9A847B4FD9A8BDEC19DE0258245@exchg-sea3-01.ant.amazon.com> It worked fine. Thanks! I think we should try and post more examples as part of the distribution package. I will try to forward some code snippit when I'm done. Thanks -Sherif -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Friday, January 06, 2006 1:41 AM To: Yacoub, Sherif Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Creating an XML without parsing an existing one Sherif, Yacoub, Sherif writes: > However, I have a question about the creation of an XML from scratch > i.e. I don't have an XML and I want my program to create it. > > Using the library example in the distribution, what will be the > constructor to use to create an instance of the "catalog" root node > for example? Citing Section 2.7, "Mapping for Complex Types" from the manual: http://codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.7 "Additionally, the resulting C++ class defines a public constructor that takes an initializer for each member of the complex type and all its base types that belongs to the One cardinality class." Looking at the catalog type definition we conclude that the constructor won't have any arguments since the only member of this type (element book) belongs to the Sequence cardinality class (maxOccurs="unbounded"). Here is a code snippet that constructs a simple catalog from scratch: using namespace library; class catalog cat; { book b (201700735, // ISBN title ("The C++ Programming Language"), // Title genre::philosophy, // Genre "CXXPL"); // ID b.author ().push_back (author ("Bjarne Stroustrup", "1950-03-31")); cat.book ().push_back (b); } { book b (20170434, // ISBN title ("More Exceptional C++"), // Title genre::fiction, // Genre "MECXX"); // ID author a ("Herb Sutter", "1960-03-31"); a.recommends ("CXXPL"); b.author ().push_back (a); cat.book ().push_back (b); } // The cat object now contains two books. hth, -boris From boris at codesynthesis.com Wed Jan 11 05:57:10 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] VC++ warning C4239 (Was: Problem with duplicate Ids) In-Reply-To: <20051223154608.GA21210@karelia> References: <55C5826684EBA046B491E70A8F7A99BC0DF237FC@lon0356xns.fm.rbsgrp.net> <20051223154608.GA21210@karelia> Message-ID: <20060111105710.GA6903@karelia> Mark, In the code you sent me I noticed that you use prologue to disable a couple of warnings: // Suppress warning about auto_ptr assignment (problem on Windows only). #pragma warning(disable:4239) // Suppress warning about non dll-interface class '...' used as base // for dll-interface class #pragma warning(disable:4275) I could reproduce 4275 and I have disabled it for the generated code. However, I could not get 4239 to show up. Could you perhaps show me the part from the generated code that triggers this warning? I would like to get rid of all phony warnings so that the generated code compiles cleanly. 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/20060111/e50ac18e/attachment.pgp From boris at codesynthesis.com Tue Jan 17 03:44:17 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] xsd 1.8.0 released Message-ID: <20060117084417.GB15004@karelia> Good day, We've released xsd 1.8.0. The NEWS file entries for this version are as follows: * Moved to the build 0.2 series. cxx-tree * Support for default and fixed values in attributes. An optional attribute with a default or fixed value is mapped to the One cardinality class instead of the Optional cardinality class. * Mapping for base64Binary and hexBinary has improved. Now these types support a basic buffer abstraction and perform automatic encoding and decoding. * Internal names are protected. We've noticed (via bug reports) a wide use of internal names (name that start with _xsd_) in user code. This is not portable and instead you should use public names. To prevent this from happening in the future we've made all internal names protected. cxx-parser * Support for Expat as the underlying XML parser in addition to Xerces-C++. This allows one to use the C++/Parser mapping in memory-constrained environments such as embedded systems. To select Expat instead of Xerces-C++ (default) add '--xml-parser expat' to the command line. At the moment only 'char' (UTF-8) is supported as the base character type when Expat is selected. * The invalid_instance exception has been renamed to parsing. * Generic error_handler interface has been added in addition to Xerces-C++-specific DOMErrorHandler. It allows you to handle parsing errors and warnings without having to deal with Xerces-C++ specifics. * The default error handling behavior has changed in parsing functions. Instead of printing errors and warnings to STDERR, the errors are now collected and thrown as part of the parsing exception. * In parsing functions, the name, namespace arguments order has been reversed to be consistent with the one used in parsing hooks. With this version we also added support for the following C++ compilers: * Sun C++ 5.8 (Studio 11) * Microsoft Visual C++ 8 (Visual Studio 2005) Precompiled binary distributions for various platforms are available from the product's web page: http://codesynthesis.com/products/xsd/ Source code for this release is available from the project's web page: http://codesynthesis.com/projects/xsd/ SHA1 checksums for the files: 554b6904a5bdc60ba7751e558524f74f24e615ab xsd-1.8.0.tar.bz2 0c3f152dde933abdbe436ef35b6df9bc365c17f5 xsd_1.8.0-1_i386.deb bb25f1da3fa088291bd81346809182a93b50e514 xsd-1.8.0-1.i686.rpm 6ebc187046fd859e9e081b1c1931a3630f0609b7 xsd-1.8.0-i686-linux-gnu.tar.bz2 fa34b3833cdf5c2bf0d17f9581b7d7d512440868 xsd_1.8.0-1_amd64.deb c7e4db55fb49dfb67661d1cd44b9bf792c259d14 xsd-1.8.0-1.x86_64.rpm 3eed6951c3ad3dcadbfdac7cc1433995e0d16053 xsd-1.8.0-x86_64-linux-gnu.tar.bz2 b35b5b89b270598a810b7e17837bbccd3612f9ec xsd-1.8.0-powerpc-macosx.tar.bz2 8bdb8496c831a409915fe469b6a47e50496caaf1 xsd-1.8.0-sparc-solaris.tar.bz2 a9961ed49f7d37e52eb788afbe46dd0f781a9385 xsd-1.8.0-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/20060117/86329090/attachment.pgp From David.Wood at alltel.com Thu Jan 19 17:14:14 2006 From: David.Wood at alltel.com (David.Wood@alltel.com) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Evaluating xsd for HP-UX Message-ID: <366E7A27AE1C0349AC47BBF61F41CF4B06AC42@scarlitnt640.alltel.com> Hi. I am evaluating several tools like xsd to generate C++ code to marshal and unmarshal XML documents. Would like to ask a few basic questions: The web site states that xsd generates platform-independent C++ code. To what standard does the generated code comply (ANSI ...)? Since the generated code is platform-independent, I assume that I can generate the code on a Windows and Solaris OS, but actually compile and link the code on an HP-UX. Is this assumption correct? Is there anyone on this list that is using xsd generated code on an HP-UX 11 server and compiled with the aCC compiler, and runs in same HP-UX 11 environment as part of a production application? (I would be interested in speaking with you, if you would be so kind.) Would like to get an HP-UX 11 binary. Thank you in advance for you constructive responses. - Wood ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, ALLTEL requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From boris at codesynthesis.com Fri Jan 20 04:19:35 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Evaluating xsd for HP-UX In-Reply-To: <366E7A27AE1C0349AC47BBF61F41CF4B06AC42@scarlitnt640.alltel.com> References: <366E7A27AE1C0349AC47BBF61F41CF4B06AC42@scarlitnt640.alltel.com> Message-ID: <20060120091935.GA20637@karelia> David, David.Wood@alltel.com writes: > The web site states that xsd generates platform-independent C++ code. > To what standard does the generated code comply (ANSI ...)? To ISO/ANSI C++ (ISO/IEC 14882:1998). > Since the generated code is platform-independent, I assume that I can > generate the code on a Windows and Solaris OS, but actually compile > and link the code on an HP-UX. Is this assumption correct? That's correct. > Is there anyone on this list that is using xsd generated code on an > HP-UX 11 server and compiled with the aCC compiler, I tried to compile xsd examples with aCC A.06.05. I got quite a few warnings about std::auto_ptr and some errors about unresolved names. The errors seem to be due to the following construct void f () { using namespace N; f (); // f is in N } but I haven't tried to pin-point exactly what's causing them. They can be easily worked around thought (at the expense of code readability). Also the latest version of the compiler (A.06.06) might have this fixed. > Would like to get an HP-UX 11 binary. I will try to build you one early next week. 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/20060120/4e546d0f/attachment.pgp From boris at codesynthesis.com Sun Jan 22 23:54:15 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Evaluating xsd for HP-UX In-Reply-To: <366E7A27AE1C0349AC47BBF61F41CF4B06AC42@scarlitnt640.alltel.com> References: <366E7A27AE1C0349AC47BBF61F41CF4B06AC42@scarlitnt640.alltel.com> Message-ID: <20060123045415.GA10532@karelia> David, David.Wood@alltel.com writes: > Would like to get an HP-UX 11 binary. BTW, which architecture are you interested in, PA-RISC or Itanium? -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/20060123/e3d7adb9/attachment.pgp From David.Wood at alltel.com Mon Jan 23 17:54:57 2006 From: David.Wood at alltel.com (David.Wood@alltel.com) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Evaluating xsd for HP-UX Message-ID: <366E7A27AE1C0349AC47BBF61F41CF4B3C420F@scarlitnt640.alltel.com> HP-UX 11, PA-RISC, 64-bit (preferred) Thanks, Boris! David -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Sunday, January 22, 2006 11:54 PM To: Wood, David Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Evaluating xsd for HP-UX David, David.Wood@alltel.com writes: > Would like to get an HP-UX 11 binary. BTW, which architecture are you interested in, PA-RISC or Itanium? -boris ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, ALLTEL requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From nelson.faria at netcabo.pt Tue Jan 24 13:54:20 2006 From: nelson.faria at netcabo.pt (Nelson Silva) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] c++ xsd and java data binding Message-ID: <43D677DC.6070301@netcabo.pt> Hi, I'm using xsd in a C++ application and need to exchange messages with JAVA clients. I've been using jibx on the Java side, but it has no support for the noNamespaceSchemaLocation. Is there a way to specify the xsd to be used when reading from an inputStream ?! This way the xsds will be hardcoded in the application. Regards, Nelson Silva From boris at codesynthesis.com Tue Jan 24 14:11:45 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] c++ xsd and java data binding In-Reply-To: <43D677DC.6070301@netcabo.pt> References: <43D677DC.6070301@netcabo.pt> Message-ID: <20060124191145.GA17368@karelia> Nelson, Nelson Silva writes: > Is there a way to specify the xsd to be used when reading from an > inputStream ?! This way the xsds will be hardcoded in the application. Yes, FAQ#2.4: http://codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#2.4 ;-) 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/20060124/d5f32ce6/attachment.pgp From nelson.faria at netcabo.pt Tue Jan 24 14:23:29 2006 From: nelson.faria at netcabo.pt (Nelson Silva) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] c++ xsd and java data binding In-Reply-To: <20060124191145.GA17368@karelia> References: <43D677DC.6070301@netcabo.pt> <20060124191145.GA17368@karelia> Message-ID: <43D67EB1.5040507@netcabo.pt> I was using the cxx-tree, are there any significant code changes to user the parser instead ?! What's the advantage of one vs the other ? Performance wise? Thanks for your prompt reply :) Boris Kolpackov wrote: > Nelson, > > Nelson Silva writes: > > >> Is there a way to specify the xsd to be used when reading from an >> inputStream ?! This way the xsds will be hardcoded in the application. >> > > Yes, FAQ#2.4: > > http://codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#2.4 > > ;-) > > hth, > -boris > From nelson.faria at netcabo.pt Tue Jan 24 14:33:53 2006 From: nelson.faria at netcabo.pt (Nelson Silva) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] c++ xsd and java data binding In-Reply-To: <43D67EB1.5040507@netcabo.pt> References: <43D677DC.6070301@netcabo.pt> <20060124191145.GA17368@karelia> <43D67EB1.5040507@netcabo.pt> Message-ID: <43D68121.5070309@netcabo.pt> Found the problem! It was solved in v 1.6 :P I was using 1.3! Great job people :) Congrats on this fine product! Nelson Silva wrote: > I was using the cxx-tree, are there any significant code changes to > user the parser instead ?! > > What's the advantage of one vs the other ? Performance wise? > > Thanks for your prompt reply :) > > Boris Kolpackov wrote: >> Nelson, >> >> Nelson Silva writes: >> >> >>> Is there a way to specify the xsd to be used when reading from an >>> inputStream ?! This way the xsds will be hardcoded in the application. >>> >> >> Yes, FAQ#2.4: >> >> http://codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#2.4 >> >> ;-) >> >> hth, >> -boris >> > > _______________________________________________ > xsd-users mailing list > xsd-users@codesynthesis.com > http://codesynthesis.com/mailman/listinfo/xsd-users > From boris at codesynthesis.com Wed Jan 25 09:24:22 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Evaluating xsd for HP-UX In-Reply-To: <366E7A27AE1C0349AC47BBF61F41CF4B3C420F@scarlitnt640.alltel.com> References: <366E7A27AE1C0349AC47BBF61F41CF4B3C420F@scarlitnt640.alltel.com> Message-ID: <20060125142422.GA20501@karelia> David, David.Wood@alltel.com writes: > HP-UX 11, PA-RISC, 64-bit (preferred) I built you the binary which you can get at http://codesynthesis.com/~boris/tmp/xsd-1.8.0-1-hppa2.0w-hpux.tar.bz2 This is a pre-release of 1.9.0. I tested it with aCC A.03.63 (on PA-RISC) and A.06.05 (on IA-64). Newer versions should also work. Older ones may not work. I compiled examples with the following command line: $ cd examples/cxx/tree $ gmake CXX="aCC" CXXFLAGS="-AA +Z +W849" CPPFLAGS="-I.../xerces-c-src_2_7_0-hppa-hpux-aCC3/include" LDFLAGS="-L.../xerces-c-src_2_7_0-hppa-hpux-aCC3/lib" Note that C++/Parser examples (ones in examples/cxx/parser) are not yet ported to work with A.03.63 (though A.06.05 works fine). Let me know if you run into 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/20060125/a3b69e72/attachment.pgp From David.Wood at alltel.com Thu Jan 26 09:15:20 2006 From: David.Wood at alltel.com (David.Wood@alltel.com) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Evaluating xsd for HP-UX Message-ID: <366E7A27AE1C0349AC47BBF61F41CF4B3C4227@scarlitnt640.alltel.com> Thank you, Boris. My team will give it a try and let you know of our success. David -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Wednesday, January 25, 2006 9:24 AM To: Wood, David Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] Evaluating xsd for HP-UX David, David.Wood@alltel.com writes: > HP-UX 11, PA-RISC, 64-bit (preferred) I built you the binary which you can get at http://codesynthesis.com/~boris/tmp/xsd-1.8.0-1-hppa2.0w-hpux.tar.bz2 This is a pre-release of 1.9.0. I tested it with aCC A.03.63 (on PA-RISC) and A.06.05 (on IA-64). Newer versions should also work. Older ones may not work. I compiled examples with the following command line: $ cd examples/cxx/tree $ gmake CXX="aCC" CXXFLAGS="-AA +Z +W849" CPPFLAGS="-I.../xerces-c-src_2_7_0-hppa-hpux-aCC3/include" LDFLAGS="-L.../xerces-c-src_2_7_0-hppa-hpux-aCC3/lib" Note that C++/Parser examples (ones in examples/cxx/parser) are not yet ported to work with A.03.63 (though A.06.05 works fine). Let me know if you run into any problems. -boris ****************************************************************************************** The information contained in this message, including attachments, may contain privileged or confidential information that is intended to be delivered only to the person identified above. If you are not the intended recipient, or the person responsible for delivering this message to the intended recipient, ALLTEL requests that you immediately notify the sender and asks that you do not read the message or its attachments, and that you delete them without copying or sending them to anyone else. From david.r.moss at selex-comm.com Fri Jan 27 06:06:25 2006 From: david.r.moss at selex-comm.com (Moss, David R (SELEX Comms) (UK Christchurch)) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Data validation Message-ID: If in a schema I have a restricted data type defined as: then on parsing an xml file with an element of that type outside of that range will throw an exception as expected: 999 Datatype error: Type:InvalidDatatypeFacetException, Message:Value '999' must be less than or equal to MaxInclusive '200' . However, if I want to modify / create some data programmatically no such validation occurs. The following compiles, runs and serializes back to an xml file without any problem: myInt i(9999999); Is there any way to use the underlying validation used when an xml file is parsed to check the validity of objects instantiated in this way? Cheers, Dave. Dave Moss SELEX Communications Grange Road Christchurch Dorset BH23 4JE United Kingdom Tel: + 44 (0) 1202 404841 Email: david.r.moss@seleniacomm.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 -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060127/247dbdde/attachment.htm From jmalv04 at gmail.com Fri Jan 27 07:05:05 2006 From: jmalv04 at gmail.com (Jose) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Using XSD with RDF Message-ID: <2084b47d0601270405hdd1090es13daa08ef2e05a14@mail.gmail.com> Hi, I am just starting to familiarize with XSD. Does anybody have experience using it with RDF schema ? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060127/7121d2bf/attachment.html From boris at codesynthesis.com Fri Jan 27 08:15:35 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Data validation In-Reply-To: References: Message-ID: <20060127131535.GA29739@karelia> David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > If in a schema I have a restricted data type defined as: > > > > > > > > > > > then on parsing an xml file with an element of that type outside of that > range will throw an exception as expected: > > 999 > > Datatype error: Type:InvalidDatatypeFacetException, Message:Value '999' > must be less than or equal to MaxInclusive '200' . > > > However, if I want to modify / create some data programmatically no such > validation occurs. The following compiles, runs and serializes back to > an xml file without any problem: > > myInt i(9999999); > > Is there any way to use the underlying validation used when an xml file > is parsed to check the validity of objects instantiated in this way? Validation of in-memory tree is on our TODO list. When it is implemented the above code will simply throw an exception. There will also be the validate() function which you will be able to call on the root of the tree and it will check constraints that cannot be validated right away, for example, minOccurs constraint in xsd:element definition. While this facility is not available, the next thing to try would be to serialize the document to DOM and validate that. Unfortunately, Xerces-C++ does not support DOM validation (hopefully they will add it in 3.0). So, for now, the only way to do what you want is to serialize the tree all the way to XML (e.g, in a memory buffer) and re-parse it to detect errors. I agree this is backwards. 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/20060127/dce7953c/attachment.pgp From boris at codesynthesis.com Fri Jan 27 08:36:46 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Using XSD with RDF In-Reply-To: <2084b47d0601270405hdd1090es13daa08ef2e05a14@mail.gmail.com> References: <2084b47d0601270405hdd1090es13daa08ef2e05a14@mail.gmail.com> Message-ID: <20060127133646.GA29861@karelia> Jose, Jose writes: > Does anybody have experience using it with RDF schema ? Is there an XML Schema definition for RDF (or, I assume, RDF/XML)? If you can point me to one I will give it a try. 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/20060127/4d621e95/attachment.pgp From fil at immi.inesc-id.pt Sun Jan 29 13:12:48 2006 From: fil at immi.inesc-id.pt (Filipe Dias) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Changes in xsd:choice from 1.3.0 to 1.8.0 ? Message-ID: <003f01c624ff$a1015f80$0b28c192@obelix> Hello, I'm new to this mailinglist, so I don't know if a similar question has been made.. I made some code using XSD in verstion 1.3.0 to read the following portion of schema: The C++ code I was using is: bool ReadXSD(GidesGeometry_t *ggeom_data){ if(ggeom_data->shape.present()) _s = ggeom_data->shape(); ... } In version 1.3.0, that 3rd line of code returned an object of type "GidesShape_t" Now, in version 1.8.0, it returns: "GidesShape_t::shape::container" How do I reach the GidesShape_t object in version 1.8.0? Thanks, Fil. From boris at codesynthesis.com Sun Jan 29 14:39:57 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Changes in xsd:choice from 1.3.0 to 1.8.0 ? In-Reply-To: <003f01c624ff$a1015f80$0b28c192@obelix> References: <003f01c624ff$a1015f80$0b28c192@obelix> Message-ID: <20060129193957.GA4956@karelia> Filipe, Filipe Dias writes: > I made some code using XSD in verstion 1.3.0 to read the following portion > of schema: > > > > > > > > > > > > > > The C++ code I was using is: > > bool ReadXSD(GidesGeometry_t *ggeom_data){ > if(ggeom_data->shape.present()) > _s = ggeom_data->shape(); > ... > } > > In version 1.3.0, that 3rd line of code returned an object of type > "GidesShape_t" This has changed in 1.4.0 which was announced here: http://codesynthesis.com/pipermail/xsd-users/2005-October/000054.html If you are interested in motivation for this change, you can check this message: http://codesynthesis.com/pipermail/xsd-users/2005-September/000041.html > Now, in version 1.8.0, it returns: "GidesShape_t::shape::container" > > How do I reach the GidesShape_t object in version 1.8.0? You can write it like this: if(ggeom_data->shape().present()) _s = ggeom_data->shape().get (); or, using pointer notation, if(ggeom_data->shape()) _s = *ggeom_data->shape(); or, if you don't want to call ggeom_data->shape() twice, if(GidesShape_t::shape::container s = ggeom_data->shape()) _s = *s; 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/20060129/8397b202/attachment.pgp From ken.ng at martoneradiotech.com Mon Jan 30 13:38:23 2006 From: ken.ng at martoneradiotech.com (Ken Ng) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Possible XSD v1.8.0 bugs. Message-ID: <43DE5D1F.4080904@martoneradiotech.com> Hi there, I'm new to XML, XML schemas, and XSD for that matter. It seems to me that XSD version 1.8.0 produces *.cxx code that causes the provided sample source named "library" to be non-executable producing the error message: driver library.xml expected element 'http://www.codesynthesis.com/library#catalog' instead of 'http://www.codesynthesis.com/library#lib:catalog' make: *** [run] Error 1 Apparently, XSD version 1.8.0 produces code that is missing the "lib:" namespace in the following functions: ::std::auto_ptr< ::library::_xsd_catalog::type > catalog (::xercesc::DOMDocument const& d, ::xsd::cxx::tree::flags f, ::xsd::cxx::tree::properties< char > const&), void catalog (::xercesc::DOMDocument& d, ::library::_xsd_catalog::type const& s, ::xsd::cxx::tree::flags) I'm not sure whether the other static functions require this too. In addition to the possible "lib:" namespace bug, it seems that XSD v1.8.0 generates "optional_functor" objects instead of the expected "one_functor" objects for the elements that are DEEPLY nested inside the "choice" XML tag. I'm not sure if this is intentional. If this is intentional, I apologize for bringing this up. Thanks, Ken From boris at codesynthesis.com Mon Jan 30 14:52:07 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Possible XSD v1.8.0 bugs. In-Reply-To: <43DE5D1F.4080904@martoneradiotech.com> References: <43DE5D1F.4080904@martoneradiotech.com> Message-ID: <20060130195207.GA14358@karelia> Ken, Ken Ng writes: > Hi there, I'm new to XML, XML schemas, and XSD for that matter. Welcome to the messy world of XML ;-) > It seems to me that XSD version 1.8.0 produces *.cxx code that causes the > provided sample source named "library" to be non-executable producing > the error message: > > driver library.xml > expected element 'http://www.codesynthesis.com/library#catalog' instead > of 'http://www.codesynthesis.com/library#lib:catalog' > make: *** [run] Error 1 Hm, I've never seen anything like this. The library example works fine for me. I will need some more information from you to track this problem down: * Compiler/Platform you are building the example on. * Version of Xerces-C++ library you are using. * I will need the library.xsd, library.xml, driver.cxx, library.hxx, library.ixx and library.cxx files that you used to build the example. You can just zip or .tar.gz the whole library directory and send it to me (off list). > In addition to the possible "lib:" namespace bug, it seems that XSD > v1.8.0 generates "optional_functor" objects instead of the expected > "one_functor" objects for the elements that are DEEPLY nested inside the > "choice" XML tag. I'm not sure if this is intentional. At the moment all elements within the choice are treated as belonging to either the Optional or Sequence cardinality classes. This is what one would expect, except in those rare cases when all arms of the choice contain some element, in which case such an element actually belongs to the One cardinality class. We are planning to fix this in upcoming versions. 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/20060130/998b124f/attachment.pgp From boris at codesynthesis.com Tue Jan 31 10:10:15 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Possible XSD v1.8.0 bugs. In-Reply-To: <43DE97A4.9020901@martoneradiotech.com> References: <43DE5D1F.4080904@martoneradiotech.com> <20060130195207.GA14358@karelia> <43DE97A4.9020901@martoneradiotech.com> Message-ID: <20060131151015.GA20283@karelia> Ken, Ken Ng writes: > I found out that it was my fault. I looked at the header file for the > generated source code for library.xsd and saw that it accepts a > DOMDocument & object, so I had crafted up a DOMDocument object and tried > passing it in: > > XercesDOMParser parser; > parser.parse(xml_file); > auto_ptr > kr(element( *(dynamic_cast *>(parser.getDocument()) )) ); > > Upon inspecting why it didn't work, I found that I could make it work if > the function call "getLocalName()" in file xsd/cxx/xml/dom/elements.hxx > was changed to "getNodeName()". getNodeName returns a name with a namespace prefix while getLocalName returns an unprefixed name. XML prefixes are syntactic sugar which, in the code, are resolved to XML namespaces and all the dealings happen with the namespace-qualified names. I think your example above failed with getLocalName because your XML document did not conform to the namespace requirements of the library.xsd schema. 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/20060131/3325bd42/attachment.pgp From boris at codesynthesis.com Tue Jan 31 10:31:05 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Data validation In-Reply-To: References: Message-ID: <20060131153105.GB20283@karelia> David, Moss, David R (SELEX Comms) (UK Christchurch) writes: > Excellent news that's it's on your list of things to do - I shall await > the next version rather than reform xml files. Any idea on timescales > for this?! :) There is no precise time-table. The next version (1.9.0) which is scheduled for release some time next week, will (hopefully) be the last in the 1.x series and won't include any significant new features - mostly code cleanups, support for extra platforms/compilers (notably HP-UX/aCC) and small fixes. After that we will start working on 2.0.0, with the major new feature being the new parser architecture which will be able to handle repeated element definitions. The in-memory validation is going to be added gradually over several versions, starting from the built-in types and structure and continuing with the more complicated cases, such as facet- based restrictions on simple types, etc. Some of these might end up in 2.0.0 but most likely in 2.0.1. The 2.0.0 is scheduled for around March 6. If you could give us a list of schema constraints that are important to you, we will try to add them first. 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/20060131/eeac2467/attachment.pgp From boris at codesynthesis.com Tue Jan 31 10:42:28 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:42 2009 Subject: [xsd-users] Using XSD with RDF In-Reply-To: <2084b47d0601270825u617bb8a4wb308e72e80815aec@mail.gmail.com> References: <2084b47d0601270405hdd1090es13daa08ef2e05a14@mail.gmail.com> <20060127133646.GA29861@karelia> <2084b47d0601270825u617bb8a4wb308e72e80815aec@mail.gmail.com> Message-ID: <20060131154228.GC20283@karelia> Jose, Sorry that it took me so long to reply. Also could you please keep the xsd-users mailing list CC'ed so that others could benefit from the information. Jose writes: > I am looking for ideas on how to use XSD to the broad range of RDF schemas > available. A very useful example is the RSS RDF schema > > http://web.resource.org/rss/1.0/schema.rdf > > I think XSD should consider these RDF schemas as it would broaden the appeal > of the library significantly. I looked over schema.rdf and I don't seem to have an idea what a mapping from RDF Schema to a programming language would look like. The schema does not seem to define any structure. Maybe you have some insights? 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/20060131/229317b3/attachment.pgp From boris at codesynthesis.com Tue Jan 31 10:50:17 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Using XSD with RDF In-Reply-To: <2084b47d0601271020h1fa57f43k14cdc6825565b63f@mail.gmail.com> References: <2084b47d0601270405hdd1090es13daa08ef2e05a14@mail.gmail.com> <20060127133646.GA29861@karelia> <2084b47d0601270825u617bb8a4wb308e72e80815aec@mail.gmail.com> <2084b47d0601271020h1fa57f43k14cdc6825565b63f@mail.gmail.com> Message-ID: <20060131155017.GD20283@karelia> Jose, Jose writes: > Before considering the RDF schema I would like to know whether XSD can > tackle parsing the RDF file as XML. You probably mean if XSD (the tool) can generate the code to parse RDF as an XML. > That by itself would make XSD very useful to me. I imagine it's > possible but I am not sure > > Here is a sample for RSS RDF It is definitely possible if you can come up with an XML Schema definition for your RSS RDF. Looking at the instance below it looks very similar to an RSS instance with RDF extensions. There is an XML Schema for RSS 2.0 available: http://www.thearchitect.co.uk/schemas/ hth, -boris > > xmlns:dc="http://purl.org/dc/elements/1.1/" > xmlns:rss="http://purl.org/rss/1.0/" > xmlns="http://purl.org/rss/1.0/"> > > timbl's blog > http://dig.csail.mit.edu/breadcrumbs/blog/4 > > > > > > > > > > > > > > Backward and Forward links in RDF just as important > > http://dig.csail.mit.edu/breadcrumbs/node/72 > <p><em><a > href="http://www.ctaz.com/~dmn1/hein.htm">Piet Hein</a>, I > think, <a href="http://chat.carleton.ca/~tcstewar/grooks/grooks.html">Grooked</a> > that,</p> > > <p>"Two types that had far better leave to their betters<br /> > the civilized art of exchanging letters<br /> > are those who disdain to make any response,<br /> > and those who infallibly answer at once!"</p> > <p>The regularity of this blog fails on both counts.</em></p> > > <p>One meme of RDF ethos is that the direction one choses for a > given property is arbitrary: it doesn't matter whether one defines > "parent" or "child"; "employee" or "employer". This philosophy (from > the Enquire design of 1980) is that one should not favor one way over > another. One day, you may be interested in following the link one > way, another day, or somene else, the other way. </p> > <p>On the other hand, also one should not encourage people > having to declare both a property and its inverse, which would simply > double the number of definitions out there, and give one more axis of > arbitrary variation in the way information is expressed. Therefore, > the design of the tabulator was is to make the system treat forward > and backward links equivalently.</p> > <p>The design of <a > href="http://www.w3.org/DesignIssues/Notation3">N3</a> also > was influenced by this. The ability to write</p> > > <p>:Joe is f:parent of :Fred.</p> > <p>makes it easier to write (or generate) N3 without having to > use f:child. This in turn reduces the pressure to define > both.</p> > <p>The only loss in not having both is that there is no label > for the reverse link. (In same cases I have defined an unnamed > predicate which is delcared as the inverse and has a label.)</p> > > 2006-01-25T16:21:17Z > -------------- 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/20060131/4868bef3/attachment.pgp From jmalv04 at gmail.com Tue Jan 31 13:11:01 2006 From: jmalv04 at gmail.com (Jose) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Using XSD with RDF In-Reply-To: <20060131155017.GD20283@karelia> References: <2084b47d0601270405hdd1090es13daa08ef2e05a14@mail.gmail.com> <20060127133646.GA29861@karelia> <2084b47d0601270825u617bb8a4wb308e72e80815aec@mail.gmail.com> <2084b47d0601271020h1fa57f43k14cdc6825565b63f@mail.gmail.com> <20060131155017.GD20283@karelia> Message-ID: <2084b47d0601311011o73a73da8y7d15536569353981@mail.gmail.com> Boris, I will try to test XSD with the RSS 2.0 schema you point out. Glancing at the schema, do you see anything that might cause XSD to malfunction ? I am trying to familiarize with XSD before thinking of using it with RDF schemas. Thanks and regards, Jose On 1/31/06, Boris Kolpackov wrote: > > Jose, > > Jose writes: > > > Before considering the RDF schema I would like to know whether XSD can > > tackle parsing the RDF file as XML. > > You probably mean if XSD (the tool) can generate the code to parse > RDF as an XML. > > > That by itself would make XSD very useful to me. I imagine it's > > possible but I am not sure > > > > Here is a sample for RSS RDF > > It is definitely possible if you can come up with an XML Schema > definition for your RSS RDF. Looking at the instance below it looks > very similar to an RSS instance with RDF extensions. There is an > XML Schema for RSS 2.0 available: > > http://www.thearchitect.co.uk/schemas/ > > hth, > -boris > > > > > > xmlns:dc="http://purl.org/dc/elements/1.1/" > > xmlns:rss="http://purl.org/rss/1.0/" > > xmlns="http://purl.org/rss/1.0/"> > > > > timbl's blog > > http://dig.csail.mit.edu/breadcrumbs/blog/4 > > > > > > > > > > > > > > > > > > > > > > > > > > > > Backward and Forward links in RDF just as important > > > > http://dig.csail.mit.edu/breadcrumbs/node/72 > > <p><em><a > > href="http://www.ctaz.com/~dmn1/hein.htm">Piet Hein</a>, I > > think, <a href="http://chat.carleton.ca/~tcstewar/grooks/grooks.html > ">Grooked</a> > > that,</p> > > > > <p>"Two types that had far better leave to their betters<br > /> > > the civilized art of exchanging letters<br /> > > are those who disdain to make any response,<br /> > > and those who infallibly answer at once!"</p> > > <p>The regularity of this blog fails on both > counts.</em></p> > > > > <p>One meme of RDF ethos is that the direction one choses for a > > given property is arbitrary: it doesn't matter whether one defines > > "parent" or "child"; "employee" or "employer". This philosophy (from > > the Enquire design of 1980) is that one should not favor one way over > > another. One day, you may be interested in following the link one > > way, another day, or somene else, the other way. </p> > > <p>On the other hand, also one should not encourage people > > having to declare both a property and its inverse, which would simply > > double the number of definitions out there, and give one more axis of > > arbitrary variation in the way information is expressed. Therefore, > > the design of the tabulator was is to make the system treat forward > > and backward links equivalently.</p> > > <p>The design of <a > > href="http://www.w3.org/DesignIssues/Notation3">N3</a> also > > was influenced by this. The ability to write</p> > > > > <p>:Joe is f:parent of :Fred.</p> > > <p>makes it easier to write (or generate) N3 without having to > > use f:child. This in turn reduces the pressure to define > > both.</p> > > <p>The only loss in not having both is that there is no label > > for the reverse link. (In same cases I have defined an unnamed > > predicate which is delcared as the inverse and has a label.)</p> > > > > 2006-01-25T16:21:17Z > > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.5 (GNU/Linux) > > iQGVAwUBQ9+HOciAKQuuCE8dAQINRQv9FB1w793s6Vey9aV1EOjJI3+8Q8jh/+NS > VhyIqs7StAYN0GZIIuuaMhvsezVMnwfwipLmYoSg6ao8C2bAAuQrbSBaI10lOyJ0 > RgdOqw2ibPp3zhw5CJx2Y4V/rlD5jd6BuzB0v5U41kACrQm/8LnksPs0LWzx8y7C > wHqJ7GQEX2gx2G8S6SNnbaMSjUxttJaq0t3i8yyKqxR4DRk6k09Dk6kYhM2zHCQE > afsredi8RPkaBUyJDSODVqpEex8uXKJ/UxvLFTavt2PttTahu63C5BVHO4VexvRS > mF8yMs7b4PRtG//turKxHnHy8MkDY1LujBhr6LQleYQDBu5JfKLsIjF5SSwXj0BJ > QrQBv+Vpi1C5KtYi1XE9kgeTjG3knRxxD0VR3AhTPUol8aQgebNubbVTM8nnhLU6 > CrRLh7fNc/1Rk00FKYRgc0eGPkGyE/4yjAgaoIlpVlzkQMGyAuxXfFvKmq2Sf+IE > T/n0QQSpSwpxXjktv0TJmd2h5K6LF0+j > =z/Wz > -----END PGP SIGNATURE----- > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060131/3f6bdd26/attachment.htm From boris at codesynthesis.com Tue Jan 31 15:03:01 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:43 2009 Subject: [xsd-users] Using XSD with RDF In-Reply-To: <2084b47d0601311011o73a73da8y7d15536569353981@mail.gmail.com> References: <2084b47d0601270405hdd1090es13daa08ef2e05a14@mail.gmail.com> <20060127133646.GA29861@karelia> <2084b47d0601270825u617bb8a4wb308e72e80815aec@mail.gmail.com> <2084b47d0601271020h1fa57f43k14cdc6825565b63f@mail.gmail.com> <20060131155017.GD20283@karelia> <2084b47d0601311011o73a73da8y7d15536569353981@mail.gmail.com> Message-ID: <20060131200301.GB20912@karelia> Jose, Jose writes: > I will try to test XSD with the RSS 2.0 schema you point out. Glancing at > the schema, do you see anything that might cause XSD to malfunction ? This schema is part of our regression test repository so it shouldn't have any problems. Furthermore, one of our clients is using it in one of their products to parse RSS feeds. > I am trying to familiarize with XSD before thinking of using it with RDF > schemas. Cool. Let me know if you run into any problems. 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/20060131/b0007727/attachment.pgp