From boris at codesynthesis.com Sat Apr 1 11:06:59 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] Create Containers In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C51E73842@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C51E73842@MAILIS.pecs.com> Message-ID: <20060401160659.GA14407@karelia> Hi Abhishek, Agarwal, Abhishek writes: > Is there a way that we can create containers using xsd? Well, that depends on what you mean by "containers" ;-). This word without any context could mean thousand different things. So it would be a good start to give us an idea about what you are trying to achieve. For what it's worth, xsd-generated types are usually containers, in the sense that they contain values of attributes/elements and are responsible for freeing memory they use, just like the C++ Standard library's containers, e.g., std::vector. 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/20060401/09499964/attachment.pgp From boris at codesynthesis.com Sun Apr 2 05:55:19 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to know the member functions at run time In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBC@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBC@MAILIS.pecs.com> Message-ID: <20060402095519.GA16119@karelia> Hi Yongsheng, Zhao, Yongsheng writes: > Say, I have a Task class which is generated by xsd from xml schema. But > I don't know what exactly in this class, due to this class varies from > applications. Then I need call the member functions of this class. Is > there a way to do it at run time? Does xsd provide this kind of functions? There is no way to do it completely dynamically, i.e., without any prior knowledge about the Task type. If, however, you know all the possible Task types before you compile your code then you can create a set of thunks that will allow you to call a member function generically on one of those Task instances. Suppose you have the following two Task types: xsd will generate C++ code like this: struct Task1: xml_schema::type { Priority priority () const; ... }; struct Task2: xml_schema::type { Priority priority () const; ... }; Let's say you you have a reference to xml_schema::type which you know is actually one of the Tast types and you want to call priority(). The right solution for this problem would be to factor out priority into the common TaskBase type and inherit both Task1 and Task2 from it. I assume this solution is not available to you for some reason. The next easiest way would be to do something like this: Priority task_priority (xml_schema::type const& task) { Priority p (0); if (Task1 const* t1 = dynamic_cast (&task)) { p = t1->priority (); } else if (Task1 const* t2 = dynamic_cast (&task)) { p = t2->priority (); } else { // error } return p; } If you do not want to pollute your code with all those if's then you can create a thunk table, e.g.: #include #include template Priority priority_thunk (xml_schema::type const& task) { return dynamic_cast (task)->priority (); } typedef Priority (*PriorityThunk) (xml_schema::type const& task); typedef std::map PriorityThunkMap; PriorityThunkMap priority_thunk_map; Priority task_priority (xml_schema::type const& task) { priority_thunk_map[typeid (task)] (task); } int main () { // Initialize priority_thunk_map. // priority_thunk_map[typeid (Task1)] = &priority_thunk; priority_thunk_map[typeid (Task2)] = &priority_thunk; } Finally, if you really have no way of knowing all the Task types before you compile your code (e.g., you load them dynamically at runtime) then the only solution that I can think of is to skip calling member function altogether and instead obtain a DOM node corresponding to the Tast instance, use DOM iteration methods to find a DOM node that corresponds to the element with the name "priority", and, finally, go back to a tree node: #include #include // Keeps us sane when working with Xerces. using namespace xercesc; namespace xml = xsd::cxx::xml; Priority task_priority (xml_schema::type const& task) { xml_schema::type& task = ... DOMNode const* task_node (task._node ()); DOMNode const* priority_node (0); for (DOMNode const* n (root->getFirstChild ()); n != 0; n = n->getNextSibling ()) { if (n->getNodeType () == DOMNode::ELEMENT_NODE && xml::transcode (n->getLocalName ()) == "priority") { priority_node = n; break; } } if (priority_node != 0) { // Get back to a tree node from the DOM node. // xml_schema::type& t ( *reinterpret_cast ( priority_node->getUserData (xml_schema::tree_node_key))); Priority& p (dynamic_cast (t)); return p; } else { // Error: this task does not have the priority element. } } One thing to note about this approach is that the back reference from DOM nodes to tree nodes has been added after the 2.0.0 release so you will need to update your installation. See this post for more information: http://codesynthesis.com/pipermail/xsd-users/2006-March/000274.html This will also be included in the upcoming 2.1.0 release. 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/20060402/455b1559/attachment.pgp From boris at codesynthesis.com Mon Apr 3 09:30:04 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to know the member functions at run time In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBE@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBE@MAILIS.pecs.com> Message-ID: <20060403133004.GB21919@karelia> Hi Yongsheng, Please keep xsd-users mailing list CC'ed when you reply. This way other people who have a similar question in the future will be able to find the answer by searching the archives. Zhao, Yongsheng writes: > Thanks for your reply. In your case you assume you know there is a member > function called priority() in the class. If I would like to traverse all the > member functions of the class, but I don't know what the member functions > are in prior, is there a way to do it dynamically? Thank you. You could iterate over DOM elements and attributes. This will correspond to member functions. However, if you don't know which member functions to expect, you probably also don't know which types those member functions return so I don't see how this can be useful to you. In other words, when you have a DOM node for some element or attribute "foo", you can obtain the pointer to corresponding tree node as xml_schema::type* but, since you don't know anything about "foo", you most likely also don't know anything about the actual type of the tree node. Could you tell us a little bit about what you are trying to do. Perhaps there is a better solution to your problem. 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/20060403/210247a7/attachment.pgp From yongsheng.zhao at nortelgov.com Mon Apr 3 10:20:26 2006 From: yongsheng.zhao at nortelgov.com (Zhao, Yongsheng) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to know the member functions at run time Message-ID: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBF@MAILIS.pecs.com> Hello, Boris: We are writing a framework for users' algorithms. We would like to define the algorithms' parameters inside a class using the xml schema. Since the parameters' types and names varies with algorithms, we don't want to hard code the parameters' names and types in code. We are seeking a way to get them dynamically, so that this part of the code can be resued for different algorithms, we only need to change .xsd file. You mentioned we could iterate DOM elements, do you mean the DOM for the xml file or for the xsd file? If we can iterate the DOM element for the xsd file to get the member functions, can we also get the members' types there? Thanks for your help. Yongsheng -----Original Message----- From: Boris Kolpackov [mailto:boris@codesynthesis.com] Sent: Mon 4/3/2006 9:30 AM To: Zhao, Yongsheng Cc: xsd-users@codesynthesis.com Subject: Re: [xsd-users] How to know the member functions at run time -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codesynthesis.com/pipermail/xsd-users/attachments/20060403/925bd0dd/attachment.html From boris at codesynthesis.com Mon Apr 3 11:03:33 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] How to know the member functions at run time In-Reply-To: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBF@MAILIS.pecs.com> References: <8D0C5C7A848CE0469B41D1A6C7ED3C5122FCBF@MAILIS.pecs.com> Message-ID: <20060403150333.GA22202@karelia> Hi Yongsheng, Zhao, Yongsheng writes: > We are writing a framework for users' algorithms. We would like to define > the algorithms' parameters inside a class using the xml schema. Since the > parameters' types and names varies with algorithms, we don't want to hard > code the parameters' names and types in code. We are seeking a way to get > them dynamically, so that this part of the code can be resued for different > algorithms, we only need to change .xsd file. I see. But you will still have some other parts of your code that are aware of each algorithm's parameters and types, right? Otherwise there is no way to execute those algorithms. From your previous emails I gathered that you want (or need) to use some other data structure to hold those parameters and therefore need to generically populate this structure from data types generated by xsd. Is that about right? If so then I see two potential solutions: 1. If you can pass xsd-generated types around instead of your custom data structure, then you could use generic xml_schema::type pointer or reference in your generic code. The non-generic code will then cast it to the appropriate algorithm type and extract parameters. 2. You could extract parameters in your generic code and store them in your data structure as pair list (or map). The non-generic code will then cast those xml_schema::type pointers to parameter types. > You mentioned we could iterate DOM elements, do you mean the DOM for > the xml file or for the xsd file? I meant for the XML file. > If we can iterate the DOM element for the xsd file to get the member > functions, can we also get the members' types there? Since XML Schema is XML, you could load it into a DOM document and find out element/attribute names and their (XML Schema) types. I don't, however, see how it could be useful at runtime. I think it is important to realize that in C++ there is generally no way to call a function having its name in a string or creating an instance of a type having this type's name in a string. 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/20060403/26aa0ffd/attachment.pgp From Oliver.Kowalke at infineon.com Tue Apr 4 03:31:40 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] errors with attributes named 'type' -> type_' : is not a member of 'xsd::cxx::tree::typ' Message-ID: <5D4F031442F5CB489CF88277DDBACCDD0475387D@drsse401.eu.infineon.com> Hello, I used a modified version of 'hello.xsd' XML-Schema provided by the documentation. I get an error if I try to compile (ms vc-7.1) the code generated by xsd. 'type_' : is not a member of 'xsd::cxx::tree::type' see declaration of 'xsd::cxx::tree::type' How can I fix this error without changing the hello.xsd (I've to use in another app a XML-schema which I can not change)? Regards, Oliver From boris at codesynthesis.com Tue Apr 4 04:42:04 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] errors with attributes named 'type' -> type_' : is not a member of 'xsd::cxx::tree::typ' In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD0475387D@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD0475387D@drsse401.eu.infineon.com> Message-ID: <20060404084204.GA25739@karelia> Hi Oliver, This is a known bug in MS VC++ 7.1 compiler. Please see the following thread: http://codesynthesis.com/pipermail/xsd-users/2006-March/000262.html The workaround is available here: http://codesynthesis.com/~boris/tmp/elements.hxx Replace you xsd-2.0.0-i686-windows/libxsd/xsd/cxx/tree/elements.hxx with the file above. This fix will also appear in the next release. 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/20060404/53ee1f6a/attachment.pgp From Oliver.Kowalke at infineon.com Wed Apr 5 10:13:49 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] keep_dom causes segmentation fault Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04684672@drsse401.eu.infineon.com> Hello, if I apply the keep_dom flag to the parsing function I get an segmentation fault (vc-7.1, file elements.hxx, line 442: DOMNode& n (*c->_node ()->getChildNodes ()->item (i));) if I try to access the next node: xercesc::XMLPlatformUtils::Initialize(); { std::auto_ptr< a_type > a_n( a( path, xml_schema::flags::keep_dom | xml_schema::flags::dont_initialize) ); b_type b_n = a_n->b(); c_type c_n = b_n.c(); xercesc::DOMNode * p = c_n._node(); if ( ! p) throw std::runtime_error("pointer to node is empty"); // how to access content of '' == should be 'abc' } xercesc::XMLPlatformUtils:: Terminate(); How can I access the value of if it is of type xsd:any? I want to get the String "abc". Regards, Oliver <> <> -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xsd Type: application/octet-stream Size: 564 bytes Desc: hello.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060405/818da5cb/hello.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xml Type: text/xml Size: 202 bytes Desc: hello.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060405/818da5cb/hello.bin From boris at codesynthesis.com Wed Apr 5 11:24:33 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] keep_dom causes segmentation fault In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD04684672@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD04684672@drsse401.eu.infineon.com> Message-ID: <20060405152433.GA1072@karelia> Hi Oliver, Association with DOM nodes is only maintained in the original tree and *complete* copies of the tree from root. In your code below you make copies of sub-nodes of the tree and try to ask for their DOM nodes, which are not maintained. I just checked the manual and it does not seem there is any mentioning of this restriction. I will try to update it for the next release. Oliver.Kowalke@infineon.com writes: > xercesc::XMLPlatformUtils::Initialize(); > { > std::auto_ptr< a_type > a_n( > a( > path, > xml_schema::flags::keep_dom | > xml_schema::flags::dont_initialize) ); > > b_type b_n = a_n->b(); Change this to be b_type& b_n = a_n->b(); > c_type c_n = b_n.c(); c_type& c_n = b_n.c(); Let me know if this works for you. 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/20060405/a93e36a0/attachment.pgp From boris at codesynthesis.com Thu Apr 6 04:25:10 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] question regarding to xsd:any Message-ID: <20060406082510.GB2984@karelia> Hi Oliver, Please do not send questions about xsd to me directly. Instead send them to the xsd-users mailing list so others can benefit from this information. I am forwarding your original message to the list and will reply to that. thanks, -boris ----- Forwarded message from Oliver.Kowalke@infineon.com ----- From: Oliver.Kowalke@infineon.com Subject: question regarding to xsd:any Date: Thu, 6 Apr 2006 09:36:58 +0200 Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04684674@drsse401.eu.infineon.com> To: boris@codesynthesis.com Hello Boris, I'm using xsd.any in hello.xsd in order to embed another xml document. Node 'c' contains the additional xml nodes (in other namespace). How can I access the content of node c? abc::a_type a_n( * abc::a( path_, xml_schema::flags::keep_dom | xml_schema::flags::dont_initialize) ); abc::b_type & b_n = a_n.b(); abc::c_type & c_n = b_n.c(); xercesc::DOMNode * c = c_n._node(); if ( ! c) throw std::runtime_error("pointer to DOMNode c is null"); xercesc::DOMNode * embed = c->getFirstChild(); if ( ! embed) throw std::runtime_error("pointer to DOMNode embed is null "); std::cout << xml::transcode< char >( w->writeToString( * embed) ) << std::endl; // prints nothing std::cout << xml::transcode< char >( embed ->getNodeValue() ) << std::endl; // prints nothing std::cout << xml::transcode< char >( embed ->getTextContent() ) << std::endl; // prints nothing Is it possible to create C++ classes from the schema of embed.xml and initialize it with the DOMNode returned from c->getFirstChild()? What is your suggestion? With best regards and thanks for your xsd-tool! Oliver ----- End forwarded message ----- -------------- 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/20060406/d43b9226/attachment.pgp From boris at codesynthesis.com Thu Apr 6 05:10:27 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] question regarding to xsd:any In-Reply-To: <20060406082510.GB2984@karelia> References: <20060406082510.GB2984@karelia> Message-ID: <20060406091027.GC2984@karelia> Skipped content of type multipart/mixed-------------- 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/20060406/34c85207/attachment.pgp From Oliver.Kowalke at infineon.com Thu Apr 6 08:59:11 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] parsing exception if attribute mixed=true is used Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04684677@drsse401.eu.infineon.com> Hello, I get an exception 'instance document parsing failed' if contexType has the attribute mixed=true and a text is inserted. If I embed an xml document all works fine. So I ask me by myself what I did worng?! The aim is to put text into c-tags (some text) or to put an xml document in it (123). I hope you can help me third time ;-) Regards, Oliver <> <> -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xml Type: text/xml Size: 189 bytes Desc: hello.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060406/ec00b831/hello.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xsd Type: application/octet-stream Size: 649 bytes Desc: hello.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060406/ec00b831/hello.obj From boris at codesynthesis.com Thu Apr 6 10:05:43 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] parsing exception if attribute mixed=true is used In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD04684677@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD04684677@drsse401.eu.infineon.com> Message-ID: <20060406140543.GB4293@karelia> Hi Oliver, Oliver.Kowalke@infineon.com writes: > Hello, > I get an exception 'instance document parsing failed' if contexType has > the attribute mixed=true and a text is inserted. You can catch and print that exception to get more detailed error message: catch (xml_schema::parsing const& e) { std::cerr << e << std::endl; } In your hello.xml you have: text While your schema has: which says that there should be exactly one sub-element in element 'c'. Obviously, your instance does not conform to this. Try changing it like this: 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/20060406/8cfbb5df/attachment.pgp From Oliver.Kowalke at infineon.com Mon Apr 10 03:51:40 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] xsd:any nodes not printed out Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04684679@drsse401.eu.infineon.com> Hello, nodes of type xsd:any are not printed out?! std::string as_string( abc::a_type const& n) { xml_schema::namespace_infomap map; map[""].name = "abc"; map[""].schema = "hello.xsd"; std::stringstream ss; abc::a( ss, n, map); return ss.str(); } XMLCh tempStr[100]; xercesc::XMLString::transcode("LS", tempStr, 99); xercesc::DOMImplementation * impl = xercesc::DOMImplementationRegistry::getDOMImplementation( tempStr); xercesc::DOMWriter * w = ( ( xercesc::DOMImplementationLS * )impl)->createDOMWriter(); abc::a_type a_n( * abc::a( path_, xml_schema::flags::keep_dom | xml_schema::flags::dont_initialize) ); std::cout << as_string( a_n) << std::endl; // I'm missing 'test' and 'some text> <> -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xml Type: text/xml Size: 266 bytes Desc: hello.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060410/2253bd59/hello.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xsd Type: application/octet-stream Size: 714 bytes Desc: hello.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060410/2253bd59/hello.obj From boris at codesynthesis.com Mon Apr 10 05:28:42 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] xsd:any nodes not printed out In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD04684679@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD04684679@drsse401.eu.infineon.com> Message-ID: <20060410092842.GA5633@karelia> Hi Oliver, Oliver.Kowalke@infineon.com writes: > nodes of type xsd:any are not printed out?! XSD does not support serialization of type-less content (which includes xsd:any). This feature is rather non-trivial to implement and we haven't seen much demand for it. You best bet would be to serialize the tree into a DOM document, then manually copy nodes that correspond to xsd:any from the source tree (see importNode), and, finally, serialize the document to XML. Just a side note: the main idea of tools like XSD is to provide statically- types representation of your data. If majority or significant chunk of your data is type-less, then the major benefit from using tools like XSD becomes the major burden. In this case you most likely will be better off using type- less APIs such as DOM. 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/20060410/c54dbfa7/attachment.pgp From Oliver.Kowalke at infineon.com Mon Apr 10 09:13:00 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] adding xsd:any nodes to node-objects Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04753884@drsse401.eu.infineon.com> Hello, If I want to add a xsd:any node to xml_schema::type node I've to call: b_n._node()->appendChild( dom); right? dom would be of type DOMText* (text) or DOMElement* (embedded xml). But how get I access to DOMDocument* in order to create DOMText or DOMDocument? How can I add classes of embedded xml which were generated by xsd? >Just a side note: the main idea of tools like XSD is to provide statically- >types representation of your data. If majority or significant chunk of your >data is type-less, then the major benefit from using tools like XSD becomes >the major burden. In this case you most likely will be better off using >type-less APIs such as DOM. I've to use a predefined *.xsd which contains a xsd:any node. I want to provide the users a C++-class-library in order to read and write the xml in a type-safe manner. I think xsd is well suited - but I have to provide support for the xsd:any node. That's why I'm asking a lot for xsd:any. Regards, Oliver From boris at codesynthesis.com Mon Apr 10 11:09:29 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] adding xsd:any nodes to node-objects In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD04753884@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD04753884@drsse401.eu.infineon.com> Message-ID: <20060410150929.GA9344@karelia> Hi Oliver, Oliver.Kowalke@infineon.com writes: > If I want to add a xsd:any node to xml_schema::type node I've to call: > > b_n._node()->appendChild( dom); > > right? > dom would be of type DOMText* (text) or DOMElement* (embedded xml). > > But how get I access to DOMDocument* in order to create DOMText or > DOMDocument? You can call getOwnerDocument on any DOM node, for example: DOMDocument* doc = b_n._node()->getOwnerDocument (); DOMNode* new_node = ... // create using doc b_n._node()->appendChild (new_node); > How can I add classes of embedded xml which were generated by xsd? I am not exactly sure what you mean by this. Can you provide a small example that should what you are trying to achieve? 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/20060410/b85567c6/attachment.pgp From dasein42 at earthlink.net Mon Apr 10 15:49:46 2006 From: dasein42 at earthlink.net (Andrew Glynn) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] simple regex replacements Message-ID: <7385304.1144698586324.JavaMail.root@elwamui-chisos.atl.sa.earthlink.net> I'm rather new to regex and don't know perl (my background is Smalltalk of all things). Can anyone give a simpler example of replacing one string in a namespace with another to generate a valid C++ namespace? Thanks Andrew From boris at codesynthesis.com Mon Apr 10 15:58:54 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:44 2009 Subject: [xsd-users] simple regex replacements In-Reply-To: <7385304.1144698586324.JavaMail.root@elwamui-chisos.atl.sa.earthlink.net> References: <7385304.1144698586324.JavaMail.root@elwamui-chisos.atl.sa.earthlink.net> Message-ID: <20060410195854.GB10137@karelia> Hi Andrew, Andrew Glynn writes: > I'm rather new to regex and don't know perl (my background is Smalltalk > of all things). Can anyone give a simpler example of replacing one > string in a namespace with another to generate a valid C++ namespace? A detailed explanation of how the namespace regex substitution works is available in the xsd man pages (see under the --namespace-regex option): http://codesynthesis.com/projects/xsd/documentation/xsd.xhtml If you want to replace one string with another then you can do something like this: --namespace-regex '%.* %%' Where should be replaced with an XML namespace and with a C++ namespace, e.g., --namespace-regex '%.* http://www.example.com/foo%example::foo%' We should probably have a short-cut option for cases like this that does not involve regex, something like: --namespace-map http://www.example.com/foo=example::foo 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/20060410/ee30355f/attachment.pgp From Oliver.Kowalke at infineon.com Tue Apr 11 01:48:18 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:45 2009 Subject: AW: [xsd-users] adding xsd:any nodes to node-objects Message-ID: <5D4F031442F5CB489CF88277DDBACCDD0468467E@drsse401.eu.infineon.com> Hello Boris, >> How can I add classes of embedded xml which were generated by xsd? > >I am not exactly sure what you mean by this. Can you provide a small >example that should what you are trying to achieve? The hello.xsd class-library generated by xsd allows access to the embedded xml in c-node (for instance embed.xml in the sample). I can also create a class-library for embed.xsd via xsd-tool. Access to the embedded xml would be: DOMNode * embed = c_n._node()->getFirstChild(); xyz::embed_type e_n (static_cast (embed), 0, 0); I need to know how can I add a xyz::embed_type instance to a c_n instance (other direction than previous example)? With regards, Oliver -------------- next part -------------- A non-text attachment was scrubbed... Name: embed.xml Type: text/xml Size: 158 bytes Desc: embed.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/bbdf9425/embed.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: embed.xsd Type: application/octet-stream Size: 385 bytes Desc: embed.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/bbdf9425/embed.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xml Type: text/xml Size: 233 bytes Desc: hello.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/bbdf9425/hello.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xsd Type: application/octet-stream Size: 714 bytes Desc: hello.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/bbdf9425/hello.obj From Oliver.Kowalke at infineon.com Tue Apr 11 02:17:51 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] newly added node not in list? Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04753887@drsse401.eu.infineon.com> Hello, the newly added c-node are not recognized if I iterate over the c-list of node b_n? In general how do I add text and embedded xml to a node which is of type xsd:any? regards, Oliver abc::a_type a_n( * abc::a( path_, xml_schema::flags::keep_dom | xml_schema::flags::dont_initialize) ); abc::a_type::b::container & b_n = a_n.b(); if ( b_n) { xercesc::DOMElement * c_n = b_n->_node() ->getOwnerDocument() ->createElement( xml::transcode< char >("c") ); c_n->appendChild( c_n->getOwnerDocument() ->createTextNode( xml::transcode< char >("XML Parsing Tools") ) ); b_n->_node() ->appendChild( c_n); // c-tag added to b-tag -> list of c-tags abc::b_type::c::container::iterator i = b_n->c().begin(); abc::b_type::c::container::iterator e = b_n->c().end(); while ( i != e) { abc::c_type & c_n( * i); for ( xercesc::DOMNode * child = c_n._node()->getFirstChild(); child != 0; child = child->getNextSibling() ) { boost::mutex::scoped_lock lk( mtx_); if ( child->getNodeType() == xercesc::DOMNode::ELEMENT_NODE) { std::cout << xml::transcode< char >( w->writeToString( * child) ) << std::endl; break; } else if ( child->getNodeType() == xercesc::DOMNode::TEXT_NODE) std::cout << xml::transcode< char >( child->getNodeValue() ) << std::endl; // not reached } ++i; } } } From boris at codesynthesis.com Tue Apr 11 04:10:08 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] adding xsd:any nodes to node-objects In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD0468467E@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD0468467E@drsse401.eu.infineon.com> Message-ID: <20060411081008.GA11299@karelia> Hi Oliver, Oliver.Kowalke@infineon.com writes: > The hello.xsd class-library generated by xsd allows access to the > embedded xml in c-node (for instance embed.xml in the sample). > > I can also create a class-library for embed.xsd via xsd-tool. > Access to the embedded xml would be: > > DOMNode * embed = c_n._node()->getFirstChild(); > xyz::embed_type e_n (static_cast (embed), 0, 0); > > I need to know how can I add a xyz::embed_type instance to a c_n > instance (other direction than previous example)? You cannot really add it unless there is a slot in c_type (e.g., element or attribute) for it. One way to create such a slot is to modify your hello.xsd schema: ... ... You can modify the schema only for code generation and use the original schema for validation. With c_type generated from the schema above, you can rewrite you code like this: DOMNode * embed = c_n._node()->getFirstChild(); xyz::embed_type e_n (static_cast (embed), 0, 0); c_n.embed (e_n); Also note that you will need to reset the embed element before serialization if you don't want it to be written out: c_n.embed ().reset (); 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/20060411/ca4dd9eb/attachment.pgp From boris at codesynthesis.com Tue Apr 11 04:27:14 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] newly added node not in list? In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD04753887@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD04753887@drsse401.eu.infineon.com> Message-ID: <20060411082714.GB11299@karelia> Hi Oliver, Oliver.Kowalke@infineon.com writes: > the newly added c-node are not recognized if I iterate over the c-list > of node b_n? You create a DOM node, not a tree node. None of the modifications to the underlying DOM document are reflected in the statically-typed tree. Neither do such modifications get serialized, as I pointed in one of my previous posts. So you should add your "c" node as a statically-typed tree node, not a DOM node, if you want it to appear in the tree structure: > if ( b_n) > { > xercesc::DOMElement * c_n = b_n->_node() > ->getOwnerDocument() > ->createElement( > > xml::transcode< char >("c") ); b_n->c_n ().push_back (c_type ()); c_type& new_c = b_n->c_n ().back (); > > c_n->appendChild( > c_n->getOwnerDocument() > ->createTextNode( > xml::transcode< char >("XML Parsing > Tools") ) ); The problems start here: new_c does not have a DOM node associated with it. I suppose I could extend the API to allow manually assigning DOM nodes to newly created tree nodes. My only concern is how useful would that be? In other words, once you added the text node to the new_c's underlying DOM node, what are you going to do with it? hth, -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/b3e08ec5/attachment.pgp From Oliver.Kowalke at infineon.com Tue Apr 11 04:52:59 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:45 2009 Subject: AW: [xsd-users] newly added node not in list? Message-ID: <5D4F031442F5CB489CF88277DDBACCDD04684680@drsse401.eu.infineon.com> Hi Boris, >> if ( b_n) >> { >> xercesc::DOMElement * c_n = b_n->_node() >> ->getOwnerDocument() >> ->createElement( >> >> xml::transcode< char >("c") ); > >b_n->c_n ().push_back (c_type ()); >c_type& new_c = b_n->c_n ().back (); > >> >> c_n->appendChild( >> c_n->getOwnerDocument() >> ->createTextNode( >> xml::transcode< char >("XML Parsing >> Tools") ) ); > >The problems start here: new_c does not have a DOM node associated >with it. I suppose I could extend the API to allow manually assigning >DOM nodes to newly created tree nodes. My only concern is how useful >would that be? In other words, once you added the text node to the >new_c's underlying DOM node, what are you going to do with it? The problems are caused by following: Reading an xml document conforming to hello.xsd is working (I can extract text and embedded xml document -> 'text', 'some text' from the example). Now I've problems to build an xml document with xsd generated classes (especially the c-node which can contain text or xml document). Question: How to build up xml document which contains nodes of type xsd:any? I tried to embed another xml document but failed by accessing the DOMNode of the new c-node. xyz::embed_type e_n("test text"); abc::c_type c_n; c_n.embed( e_n); b_n->c().push_back( c_n); abc::b_type::c::container::iterator i = b_n->c().begin(); abc::b_type::c::container::iterator e = b_n->c().end(); while ( i != e) { abc::c_type & c_n( * i); for ( xercesc::DOMNode * child = c_n._node()->getFirstChild(); child != 0; child = child->getNextSibling() ) {...} ++i; } -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xsd Type: application/octet-stream Size: 900 bytes Desc: hello.xsd Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/ea8e6695/hello.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: hello.xml Type: text/xml Size: 248 bytes Desc: hello.xml Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/ea8e6695/hello.bin From boris at codesynthesis.com Tue Apr 11 05:19:27 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] newly added node not in list? In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD04684680@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD04684680@drsse401.eu.infineon.com> Message-ID: <20060411091927.GA11466@karelia> Oliver, Oliver.Kowalke@infineon.com writes: > The problems are caused by following: > Reading an xml document conforming to hello.xsd is working (I can > extract text and embedded xml document -> 'text', ' xmlns="xyz">some text' from the example). > Now I've problems to build an xml document with xsd generated classes > (especially the c-node which can contain text or xml document). > > Question: How to build up xml document which contains nodes of type > xsd:any? The answer really depends on what you are going to do with such a document. Are you going to serialize it? Are you going to pass it to other parts of your program that are going to extract the xsd:any info using DOM API? If you are going to serialize it then you will need to (1) serialize statically-typed tree to a DOM document, (2) insert content corresponding to xsd:any into the DOM document, and (3) serialize DOM document to XML. In this case there is no point in trying to build statically-typed tree with nodes that correspond to xsd:any since they are not going to be picked up by the serialization process. On the other hand, if you need to build a statically-typed tree as if it was just read from a file, then I will need to add a _node (DOMNode*) function to assign DOM nodes to newly created tree nodes. Let me know if this is the case. 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/20060411/9f10ebd7/attachment.pgp From Oliver.Kowalke at infineon.com Tue Apr 11 06:09:53 2006 From: Oliver.Kowalke at infineon.com (Oliver.Kowalke@infineon.com) Date: Sun Oct 11 15:33:45 2009 Subject: AW: [xsd-users] newly added node not in list? Message-ID: <5D4F031442F5CB489CF88277DDBACCDD0475388A@drsse401.eu.infineon.com> >> Question: How to build up xml document which contains nodes of type >> xsd:any? > >The answer really depends on what you are going to do with such a >document. Are you going to serialize it? Are you going to pass it >to other parts of your program that are going to extract the xsd:any >info using DOM API? > >If you are going to serialize it then you will need to (1) serialize >statically-typed tree to a DOM document, (2) insert content corresponding >to xsd:any into the DOM document, and (3) serialize DOM document to >XML. In this case there is no point in trying to build statically-typed >tree with nodes that correspond to xsd:any since they are not going >to be picked up by the serialization process. > >On the other hand, if you need to build a statically-typed tree as if >it was just read from a file, then I will need to add a _node (DOMNode*) >function to assign DOM nodes to newly created tree nodes. Let me know >if this is the case. I provide the users a library which should contain a statically-typed tree representing an xml document structure. The users shouldn't deal with the xerces stuff. They should only be able to parse an xml file, create the tree structure and using it in their applications (serialize and modify). It should also be possible to create a statically typed tree in memory (constructing from statically typed nodes of the tree) and serialize it (to a file for instance). I would add some special functions (templated) which allow access to the content of an xsd:any node (already working -> c_type). Adding such a node to the statically typed tree (no matter if it was parsed from a file or created from classes of the tree) is the problem I want to solve. If I understand your last notice your solution would solve the problem (I hope). Regards, Oliver From boris at codesynthesis.com Tue Apr 11 07:36:38 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] newly added node not in list? In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD0475388A@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD0475388A@drsse401.eu.infineon.com> Message-ID: <20060411113638.GA11651@karelia> Hi Oliver, Oliver.Kowalke@infineon.com writes: > I would add some special functions (templated) which allow access to the > content of an xsd:any node (already working -> c_type). Adding such a > node to the statically typed tree (no matter if it was parsed from a > file or created from classes of the tree) is the problem I want to > solve. > If I understand your last notice your solution would solve the problem > (I hope). Ok, I've added the ability to set DOM nodes for tree nodes. You will need to replace your libxsd/xsd/cxx/tree/elements.hxx with this one: http://codesynthesis.com/~boris/tmp/elements.hxx For restrictions see comment before the _node(DOMNode*) function in the file above. Using this function, you will be able to write something like this: b_type& b_n = ... // parsed with keep_dom using namespace xercesc; DOMDocument* doc = b_n._node ()->getOwnerDocument(); b_n.c ().push_back (c_type ()); // Create new tree node. c_type& c_n = b_n.c ().back (); // Get ref to the new node. DOMElement* c_dom_n = doc->createElement( xml::transcode< char >("c")); // Create a dom node for the new tree node. b_n._node ()->appendChild (c_dom_n); // Add to our parent. c_n._node (c_dom_n); // Establish association. c_dom_n->appendChild( doc->createTextNode(xml::transcode< char >("XML Parsing Tools"))); 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/20060411/c5c2f4d2/attachment.pgp From boris at codesynthesis.com Wed Apr 12 06:19:32 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] Re: building statical-typed tree -> no internal DOMNodes In-Reply-To: <5D4F031442F5CB489CF88277DDBACCDD0475388B@drsse401.eu.infineon.com> References: <5D4F031442F5CB489CF88277DDBACCDD0475388B@drsse401.eu.infineon.com> Message-ID: <20060412101932.GA15409@karelia> Hi Oliver, [I've CC'ed xsd-users back in.] Oliver.Kowalke@infineon.com writes: > if I have a statical-typed tree (calsses) generated by xsd-tool - I can > construct a xml representation from this classes. > Like: > > abc::a_type a_n; > abc::b_type b_n; > a_n.b( b_n); > > But the associated DOMNodes are NULL-pointer?! That's right. You only get DOM association if the tree is created during parsing and keep_dom flag is on. There are two ways you can add DOM association to a constructed tree: 1. Manually create a DOM document and associate it with with the tree using _node (DOMNode*) function. This is a major burden for anything but trivial documents. 2. Serialize your tree into a DOMDocument and then re-parse it with the keep_dom flag. > So adding xsd:any nodes are not possible? I told you that working with type-less content in a typed tree is going to be a major pain ;-). Let me suggest a different approach to your problem. If I understood you correctly, you know what type of content might be provided for xsd:any. In your example, it is either text or a sub-document with predefined structure (embed.xsd). The idea of the approach is to "extend" the schema (hello.xsd) in such a way, that the generated code will have "slots" to hold all possible type-less content. We only use such extended schema for code generation and still use the original schema for validation so we do not actually allow non-conforming documents that resulted from such an extension. So here is how we would extend your hello.xsd to support text content and embed.xsd: ... ... Note that when the instance (hello.xml) is parsed by code generated from this schema, the embed or text still matches the xsd:any and only accessible via DOM. Now the plan works like this: 1. You wrap the parsing function. In your wrapper you will determine what type of content is in xsd:any (text or embed), extract it, and either set text_content if it was text or parse embedded xml and set embed_content. 2. You wrap serialization function. In your wrapper you remove information from either embed_content or text_content, serialize the tree to DOMDocument, patch-up the document with the info from embed_content or text_content to correspond to xsd:any, and serialize the resulting DOM document to XML. I already covered this step in one of my previous posts. 3. Clients of your library: a. Call your parser wrapper to parse XML into a tree. b. The xsd:any info is accessible to them either via embed_content or text_content. They read and modify the information only via these accessors. c. Call your serialization wrapper to write tree into XML. 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/20060412/a1e8ad9c/attachment.pgp From boris at codesynthesis.com Thu Apr 13 17:13:14 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] Memory leak - DbXml 2.2 Message-ID: <20060413211314.GA20955@karelia> Good day, Ravi Sakaria from VoicePulse Inc. was trying to use XSD-generated code together with Berkeley DB XML and ran across some mysterious memory leaks. He managed to track the problem down (with help from Sleepycat/Oracle folks) and was kind enough to let me know about this. In turn, I am forwarding this information to the xsd-users mailing list. hth, -boris From: Ravi Sakaria Subject: RE: FW: [bdbxml] Memory leak - DbXml 2.2 Date: Fri, 7 Apr 2006 16:00:55 -0400 To: Boris Kolpackov Thanks for the suggestion and insight Boris. I was able to work around the issue in my particular application by causing my Berkeley Dbxml adapter to go out of scope before instantiating one of the autogenerated classes. So instead of: * Instantiate Berkeley handles * Use Berkeley handle to get XML string from storage * Use XML string to instantiate class * Destroy Berkeley handles I simply do: * Instantiate Berkeley handles * Use Berkeley handle to get XML string * Destroy Berkeley handle * Use string to instantiate class The problem only seems to occur if there is an existing instance of the Berkeley XmlManager class. (I hope someday this saves you or someone else from banging their head against a wall like I did!) Regards, Ravi From: Boris Kolpackov Subject: Re: FW: [bdbxml] Memory leak - DbXml 2.2 Date: Fri, 7 Apr 2006 21:44:52 +0200 To: Ravi Sakaria Hi Ravi, Thanks for letting me know about this issue. As George said, it appears that DbXml "takes over" Xerces-C++ memory management in a way that prevents other applications from using Xerces-C++ functionality. One thing that you can do is to move Xerces-related memory management from the XSD runtime to your application and do it in a way that is compatible with DbXml. To achieve this, you will need to create and release DOMDocument in your application rather than delegating this task to the XSD runtime. E.g., instead of auto_ptr < hello_type > h (hello (argv[1])); you will do xercesc::DOMDocument* dom = ... // See Xerces examples on how to // parse instance into a DOM Doc. auto_ptr < hello_type > h (hello (*dom)); // Normally after that you would call dom->release () but you // will need to do something else here. hth, -boris From: Ravi Sakaria Subject: FW: [bdbxml] Memory leak - DbXml 2.2 Date: Fri, 7 Apr 2006 13:31:57 -0400 To: info@codesynthesis.com Boris, I thought you might find the following email conversation I had with George Feinberg at Sleepycat / Oracle interesting. We're trying to use their Dbxml along with classes that were autogenerated with XSD and we discovered the bug described below (it will make the most sense if you start at the bottom). Regards, Ravi > -----Original Message----- > From: George Feinberg [mailto:george.feinberg@oracle.com] > Sent: Friday, April 07, 2006 11:49 AM > To: Ravi Sakaria > Subject: Re: [bdbxml] Memory leak - DbXml 2.2 > > > Ravi, > > I see the issue. It's a problem, but I'm not yet sure how to > fix it/work around it. I may assign this to John Snelson. I've > created an SR, and you'll hear back on it. > > The basic problem is that BDB XML takes over the Xerces-C > default memory manager, which is inconsistent with the XSD > library's use. > > Thanks for the test case. > > George > > > George, > > > > OK - here's an example. The driver.cxx is an example provided with > > XSD. > > I've modified it to duplicate the memory leak I'm experiencing in > > other > > code by adding the Berkeley Dbxml "myDbxmlAdapter" class. All of my > > modifications are commented as such (just search for "Ravi"). > > > > I'm not sure how familiar you are with CodeSynthesis' XSD tool, but > > basically it took hello.xsd and autogenerated hello.cxx and hello.hxx. > > > > Please let me know if I can provide more data that might be > > helpful. I > > could even arrange for you to SSH into the box that I have this on: > > > > 1. g++ and kernel info > > 2. ldd output > > 3. compilation commands > > 4. source code > > 5. output without valgrind > > 6. output with valgrind > > > > ============= BEGN g++ and kernel info ============ > > [root@fcdev03 hello]# g++ -v > > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs > > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > > --infodir=/usr/share/info --enable-shared --enable-threads=posix > > --disable-checking --disable-libunwind-exceptions --with-system-zlib > > --enable-__cxa_atexit --host=i386-redhat-linux > > Thread model: posix > > gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) > > [root@fcdev03 hello]# uname -a > > Linux fcdev03.voicepulse.com 2.6.10-1.9_FC2 #1 Thu Jan 13 17:54:57 EST > > 2005 i686 i686 i386 GNU/Linux > > ============= END g++ and kernel info ============= > > > > ============= BEGIN LDD OUTPUT ==================== > > [root@fcdev03 hello]# ldd ./driver > > libxerces-c.so.27 => /usr/lib/libxerces-c.so.27 (0x0374b000) > > libdb_cxx-4.4.so => /usr/lib/libdb_cxx-4.4.so (0x00607000) > > libdbxml-2.2.so => /usr/lib/libdbxml-2.2.so (0x0073a000) > > libxquery-1.2.so => /usr/lib/libxquery-1.2.so (0x00393000) > > libpathan.so.3 => /usr/lib/libpathan.so.3 (0x00a97000) > > libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x009da000) > > libm.so.6 => /lib/tls/libm.so.6 (0x00111000) > > libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00730000) > > libc.so.6 => /lib/tls/libc.so.6 (0x004d1000) > > libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00134000) > > /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x004b8000) > > ============= END LDD OUTPUT ====================== > > > > ============= BEGIN COMPILATION COMMANDS ========== > > modified: > > g++ -W -Wall -c driver.cxx -o driver.o > > g++ -W -Wall -o driver driver.o hello.o -lxerces-c -ldb_cxx > > -ldbxml -lxquery -lpathan > > ============= END COMPILATION COMMANDS ============ > > > > ============= BEGIN TEST SOURCE CODE =============== > > [root@fcdev03 hello]# cat driver.cxx > > // file : examples/cxx/tree/hello/driver.cxx > > // author : Boris Kolpackov > > // copyright : not copyrighted - public domain > > > > #include // std::auto_ptr > > #include > > #include //<--Ravi > > > > #include "hello.hxx" > > > > using > > std::cerr; > > using > > std::endl; > > using > > std::auto_ptr; > > > > //// Ravi - Begin > > using namespace > > DbXml; > > > > class > > myDbxmlAdapter > > { > > public: > > myDbxmlAdapter (int x); > > ~ > > myDbxmlAdapter (); > > private: > > DbEnv * > > mpEnv; > > XmlManager * > > mpManager; > > XmlContainer * > > mpXmlContainer; > > XmlUpdateContext * > > mpUpdateContext; > > }; > > > > myDbxmlAdapter::myDbxmlAdapter (int x) > > { > > std::cout << "Inside the constructor...\n"; > > u_int32_t env_flags = > > DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | > > DB_INIT_TXN; > > mpEnv = new DbEnv (0); > > mpEnv->open ("/tmp/bdb_views", env_flags, 0); > > mpManager = new XmlManager (mpEnv); > > if (!mpManager->existsContainer ("/tmp/bdb_views/testcontainer")) > > { > > std::cout << "Container doesn't exist.\n"; > > mpXmlContainer = > > new XmlContainer (mpManager-> > > createContainer > > ("/tmp/bdb_views/testcontainer", 0, > > XmlContainer::NodeContainer, 0)); > > mpUpdateContext = > > new XmlUpdateContext (mpManager->createUpdateContext ()); > > } > > else > > { > > std::cout << "Container already exists.\n"; > > mpXmlContainer = > > new XmlContainer (mpManager-> > > openContainer > > ("/tmp/bdb_views/testcontainer", 0)); > > mpUpdateContext = > > new XmlUpdateContext (mpManager->createUpdateContext ()); > > } > > } > > > > myDbxmlAdapter::~myDbxmlAdapter () > > { > > std::cout << "Inside the destructor\n"; > > delete mpUpdateContext; > > delete mpXmlContainer; > > delete mpManager; > > mpEnv->close (0); > > delete mpEnv; > > } > > //////// Ravi - End > > > > int > > main (int argc, char *argv[]) > > { > > if (argc != 2) > > { > > cerr << "usage: " << argv[0] << " hello.xml" << endl; > > return 1; > > } > > > > /// Following two lines added by Ravi > > std::cout << "About to construct...\n"; > > myDbxmlAdapter myAdapter (5); //<-- If this is commented out, > > program > > doesn't leak > > > > try > > { > > auto_ptr < hello_type > h (hello (argv[1])); > > > > for (hello_type::name::const_iterator i (h->name ().begin ()); > > i != h->name ().end (); ++i) > > { > > cerr << h->greeting () << ", " << *i << "!" << endl; > > } > > } > > catch (xml_schema::exception const &e) > > { > > cerr << e << endl; > > return 1; > > } > > } > > ============= END TEST SOURCE CODE ================= > > > > ============= OUTPUT WITHOUT VALGRIND ============== > > [root@fcdev03 hello]# ./driver hello.xml > > About to construct... > > Inside the constructor... > > Container already exists. > > Hello, sun! > > Hello, moon! > > Hello, world! > > Inside the destructor > > ============= END OUTPUT WITHOUT VALGRIND ========== > > > > ============= BEGIN VALGRIND OUTPUT ================ > > [root@fcdev03 hello]# valgrind --leak-check=full -v ./driver hello.xml > > ==13076== Memcheck, a memory error detector. > > ==13076== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et > > al. > > ==13076== Using LibVEX rev 1575, a library for dynamic binary > > translation. > > ==13076== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. > > ==13076== Using valgrind-3.1.1, a dynamic binary instrumentation > > framework. > > ==13076== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et > > al. > > ==13076== > > --13076-- Command line > > --13076-- ./driver > > --13076-- hello.xml > > --13076-- Startup, with flags: > > --13076-- --leak-check=full > > --13076-- -v > > --13076-- Contents of /proc/version: > > --13076-- Linux version 2.6.10-1.9_FC2 > > (bhcompile@porky.build.redhat.com) (gcc version 3.3.3 20040412 (Red > > Hat > > Linux 3.3.3-7)) #1 Thu Jan 13 17:54:57 EST 2005 > > --13076-- Arch and subarch: X86, x86-sse2 > > --13076-- Valgrind library directory: /usr/local/lib/valgrind > > --13076-- Reading syms from /lib/ld-2.3.3.so (0x4B8000) > > --13076-- Reading syms from /usr/doc/xsd/examples/cxx/tree/hello/ > > driver > > (0x8048000) > > --13076-- Reading syms from /usr/local/lib/valgrind/x86-linux/memcheck > > (0xB0000000) > > --13076-- object doesn't have a dynamic symbol table > > --13076-- Reading suppressions file: > > /usr/local/lib/valgrind/default.supp > > --13076-- REDIR: 0x4C9420 (index) redirected to 0xB001AF3E > > (vgPlain_x86_linux_REDIR_FOR_index) > > --13076-- Reading syms from > > /usr/local/lib/valgrind/x86-linux/vgpreload_core.so (0x4000000) > > --13076-- Reading syms from > > /usr/local/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4003000) > > --13076-- REDIR: 0x4C95C0 (strlen) redirected to 0x4005F8C (strlen) > > --13076-- Reading syms from /usr/lib/libxerces-c.so.27.0 (0x374B000) > > --13076-- Reading syms from /usr/lib/libdb_cxx-4.4.so (0x402B000) > > --13076-- Reading syms from /usr/lib/libdbxml-2.2.so (0x73A000) > > --13076-- Reading syms from /usr/lib/libxquery-1.2.so (0x393000) > > --13076-- Reading syms from /usr/lib/libpathan.so.3.0.1 (0xA97000) > > --13076-- Reading syms from /usr/lib/libstdc++.so.5.0.5 (0x9DA000) > > --13076-- object doesn't have a symbol table > > --13076-- Reading syms from /lib/tls/libm-2.3.3.so (0x5F5000) > > --13076-- Reading syms from /lib/libgcc_s-3.3.3-20040413.so.1 > > (0x730000) > > --13076-- object doesn't have a symbol table > > --13076-- Reading syms from /lib/tls/libc-2.3.3.so (0x4D1000) > > --13076-- Reading syms from /lib/tls/libpthread-0.61.so (0x62D000) > > --13076-- REDIR: 0x4B87A0 (_dl_sysinfo_int80) redirected to 0xB001AF3B > > (???) > > --13076-- REDIR: 0x538B10 (memset) redirected to 0x4006680 (memset) > > --13076-- REDIR: 0x537D70 (rindex) redirected to 0x4005C88 (rindex) > > --13076-- REDIR: 0x5374E0 (strcpy) redirected to 0x4005FC4 (strcpy) > > --13076-- REDIR: 0x538FE0 (memcpy) redirected to 0x40062A4 (memcpy) > > --13076-- REDIR: 0x537AB0 (strnlen) redirected to 0x4005F4C (strnlen) > > --13076-- REDIR: 0x537A00 (strlen) redirected to 0x4005F70 (strlen) > > --13076-- REDIR: 0xA6D380 (operator new(unsigned)) redirected to > > 0x4004779 (operator new(unsigned)) > > --13076-- REDIR: 0x5311D0 (malloc) redirected to 0x40043EE (malloc) > > --13076-- REDIR: 0xA6D4C0 (operator new[](unsigned)) redirected to > > 0x4004BA7 (operator new[](unsigned)) > > --13076-- REDIR: 0x537CC0 (strncpy) redirected to 0x4006084 (strncpy) > > About to construct... > > Inside the constructor... > > --13076-- REDIR: 0x537300 (index) redirected to 0x4005D3C (index) > > --13076-- REDIR: 0x5336A0 (free) redirected to 0x4004EE5 (free) > > --13076-- REDIR: 0x538630 (memchr) redirected to 0x4006280 (memchr) > > --13076-- REDIR: 0x5398A0 (rawmemchr) redirected to 0x4006714 > > (rawmemchr) > > --13076-- REDIR: 0x538CD0 (stpcpy) redirected to 0x4006440 (stpcpy) > > --13076-- REDIR: 0x531350 (realloc) redirected to 0x400574C (realloc) > > --13076-- REDIR: 0x538AB0 (memmove) redirected to 0x40066A8 (memmove) > > Container already exists. > > --13076-- REDIR: 0xA6BE10 (operator delete[](void*)) redirected to > > 0x4005491 (operator delete[](void*)) > > --13076-- REDIR: 0x537470 (strcmp) redirected to 0x4006218 (strcmp) > > --13076-- REDIR: 0xA6BDB0 (operator delete(void*)) redirected to > > 0x4005179 (operator delete(void*)) > > --13076-- REDIR: 0x537BF0 (strncmp) redirected to 0x40061B8 (strncmp) > > ==13076== Conditional jump or move depends on uninitialised value(s) > > ==13076== at 0x39C7D96: > > xercesc_2_7::XMLUTF8Transcoder::transcodeFrom(unsigned char const*, > > unsigned, unsigned short*, unsigned, unsigned&, unsigned char*) (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B26F8: > > xercesc_2_7::XMLReader::xcodeMoreChars(unsigned short*, unsigned > > char*, > > unsigned) (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B0D74: xercesc_2_7::XMLReader::refreshCharBuffer() > > (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x392FAC3: xercesc_2_7::ReaderMgr::peekNextChar() (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B6BEC: xercesc_2_7::XMLScanner::scanProlog() (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39095CC: > > xercesc_2_7::IGXMLScanner::scanDocument(xercesc_2_7::InputSource > > const&) > > (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B54A6: > > xercesc_2_7::XMLScanner::scanDocument(unsigned short const*) (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x3872329: > > xercesc_2_7::AbstractDOMParser::parse(unsigned short const*) (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0xC296D8: PathanBuilderImpl::parseURI(unsigned short > > const*) (in /usr/lib/libpathan.so.3.0.1) > > ==13076== by 0x805228B: > > xsd::cxx::xml::dom::auto_ptr > > xsd::cxx::xml::dom::dom(std::basic_string > std::char_traits, std::allocator > const&, > > xercesc_2_7::DOMErrorHandler&, xsd::cxx::xml::properties const&, > > bool) (in /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804FA68: > > xsd::cxx::xml::dom::auto_ptr > > xsd::cxx::xml::dom::dom(std::basic_string > std::char_traits, std::allocator > const&, > > xsd::cxx::xml::error_handler&, xsd::cxx::xml::properties > > const&, bool) (in /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804D296: hello(std::string const&, > > xsd::cxx::tree::flags, xsd::cxx::tree::properties const&) (in > > /usr/doc/xsd/examples/cxx/tree/hello/driver) > > Hello, sun! > > Hello, moon! > > Hello, world! > > Inside the destructor > > ==13076== > > ==13076== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 23 from > > 1) > > ==13076== > > ==13076== 2 errors in context 1 of 1: > > ==13076== Conditional jump or move depends on uninitialised value(s) > > ==13076== at 0x39C7D96: > > xercesc_2_7::XMLUTF8Transcoder::transcodeFrom(unsigned char const*, > > unsigned, unsigned short*, unsigned, unsigned&, unsigned char*) (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B26F8: > > xercesc_2_7::XMLReader::xcodeMoreChars(unsigned short*, unsigned > > char*, > > unsigned) (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B0D74: xercesc_2_7::XMLReader::refreshCharBuffer() > > (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x392FAC3: xercesc_2_7::ReaderMgr::peekNextChar() (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B6BEC: xercesc_2_7::XMLScanner::scanProlog() (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39095CC: > > xercesc_2_7::IGXMLScanner::scanDocument(xercesc_2_7::InputSource > > const&) > > (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x39B54A6: > > xercesc_2_7::XMLScanner::scanDocument(unsigned short const*) (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x3872329: > > xercesc_2_7::AbstractDOMParser::parse(unsigned short const*) (in > > /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0xC296D8: PathanBuilderImpl::parseURI(unsigned short > > const*) (in /usr/lib/libpathan.so.3.0.1) > > ==13076== by 0x805228B: > > xsd::cxx::xml::dom::auto_ptr > > xsd::cxx::xml::dom::dom(std::basic_string > std::char_traits, std::allocator > const&, > > xercesc_2_7::DOMErrorHandler&, xsd::cxx::xml::properties const&, > > bool) (in /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804FA68: > > xsd::cxx::xml::dom::auto_ptr > > xsd::cxx::xml::dom::dom(std::basic_string > std::char_traits, std::allocator > const&, > > xsd::cxx::xml::error_handler&, xsd::cxx::xml::properties > > const&, bool) (in /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804D296: hello(std::string const&, > > xsd::cxx::tree::flags, xsd::cxx::tree::properties const&) (in > > /usr/doc/xsd/examples/cxx/tree/hello/driver) > > --13076-- > > --13076-- supp: 23 Ubuntu-stripped-ld.so > > ==13076== > > ==13076== IN SUMMARY: 2 errors from 1 contexts (suppressed: 23 from 1) > > ==13076== > > ==13076== malloc/free: in use at exit: 305,148 bytes in 300 blocks. > > ==13076== malloc/free: 2,898 allocs, 2,598 frees, 1,059,290 bytes > > allocated. > > ==13076== > > ==13076== searching for pointers to 300 not-freed blocks. > > ==13076== checked 1,329,884 bytes. > > ==13076== > > ==13076== > > ==13076== 32 bytes in 1 blocks are possibly lost in loss record 2 of 5 > > ==13076== at 0x400446D: malloc (vg_replace_malloc.c:149) > > ==13076== by 0x82A152: DbXml::SimpleMemoryManager::allocate > > (unsigned) > > (Globals.cpp:50) > > ==13076== by 0x399DC92: xercesc_2_7::XMemory::operator new > > (unsigned, > > xercesc_2_7::MemoryManager*) (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x3912C38: > > xercesc_2_7::XMLPlatformUtils::makeMutex(xercesc_2_7::MemoryManager*) > > (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0x82B4D7: DbXml::Globals::initialize(DbEnv*) > > (Globals.cpp:61) > > ==13076== by 0x82E49A: DbXml::Manager::initialize(DbEnv*) > > (Manager.cpp:142) > > ==13076== by 0x82D76C: DbXml::Manager::Manager(DbEnv*, unsigned) > > (Manager.cpp:82) > > ==13076== by 0x827C08: DbXml::XmlManager::XmlManager(DbEnv*, > > unsigned) (XmlManager.cpp:49) > > ==13076== by 0x804AAF1: myDbxmlAdapter::myDbxmlAdapter(int) (in > > /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804B154: main (in > > /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== > > ==13076== > > ==13076== 20,108 (80 direct, 20,028 indirect) bytes in 2 blocks are > > definitely lost in loss record 3 of 5 > > ==13076== at 0x400446D: malloc (vg_replace_malloc.c:149) > > ==13076== by 0x82A152: DbXml::SimpleMemoryManager::allocate > > (unsigned) > > (Globals.cpp:50) > > ==13076== by 0x399DC92: xercesc_2_7::XMemory::operator new > > (unsigned, > > xercesc_2_7::MemoryManager*) (in /usr/lib/libxerces-c.so.27.0) > > ==13076== by 0xC2CB64: PathanImplementation::createDOMBuilder > > (short, > > unsigned short const*, xercesc_2_7::MemoryManager*, > > xercesc_2_7::XMLGrammarPool*) (in /usr/lib/libpathan.so.3.0.1) > > ==13076== by 0x8051EDA: > > xsd::cxx::xml::dom::auto_ptr > > xsd::cxx::xml::dom::dom(std::basic_string > std::char_traits, std::allocator > const&, > > xercesc_2_7::DOMErrorHandler&, xsd::cxx::xml::properties const&, > > bool) (in /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804FA68: > > xsd::cxx::xml::dom::auto_ptr > > xsd::cxx::xml::dom::dom(std::basic_string > std::char_traits, std::allocator > const&, > > xsd::cxx::xml::error_handler&, xsd::cxx::xml::properties > > const&, bool) (in /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804D296: hello(std::string const&, > > xsd::cxx::tree::flags, xsd::cxx::tree::properties const&) (in > > /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== by 0x804B1D5: main (in > > /usr/doc/xsd/examples/cxx/tree/hello/driver) > > ==13076== > > ==13076== LEAK SUMMARY: > > ==13076== definitely lost: 80 bytes in 2 blocks. > > ==13076== indirectly lost: 20,028 bytes in 247 blocks. > > ==13076== possibly lost: 32 bytes in 1 blocks. > > ==13076== still reachable: 285,008 bytes in 50 blocks. > > ==13076== suppressed: 0 bytes in 0 blocks. > > ==13076== Reachable blocks (those to which a pointer was found) are > > not shown. > > ==13076== To see them, rerun with: --show-reachable=yes > > --13076-- memcheck: sanity checks: 142 cheap, 6 expensive > > --13076-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use > > --13076-- memcheck: auxmaps: 0 searches, 0 comparisons > > --13076-- memcheck: secondaries: 59 issued (3776k, 3M) > > --13076-- memcheck: secondaries: 176 accessible and distinguished > > (11264k, 11M) > > --13076-- tt/tc: 54,806 tt lookups requiring 70,768 probes > > --13076-- tt/tc: 54,806 fast-cache updates, 3 flushes > > --13076-- translate: new 23,006 (479,971 -> 8,534,036; ratio > > 177:10) [0 scs] > > --13076-- translate: dumped 0 (0 -> ??) > > --13076-- translate: discarded 8 (187 -> ??) > > --13076-- scheduler: 7,143,675 jumps (bb entries). > > --13076-- scheduler: 142/38,020 major/minor sched events. > > --13076-- sanity: 143 cheap, 6 expensive checks. > > --13076-- exectx: 30,011 lists, 2,899 contexts (avg 0 per list) > > --13076-- exectx: 5,521 searches, 2,757 full compares (499 per > > 1000) > > --13076-- exectx: 296 cmp2, 69 cmp4, 0 cmpAll > > ============= END VALGRIND OUTPUT ================== > > > > > >> -----Original Message----- > >> From: George Feinberg [mailto:george.feinberg@oracle.com] > >> Sent: Friday, April 07, 2006 10:07 AM > >> To: Ravi Sakaria > >> Subject: Re: [bdbxml] Memory leak - DbXml 2.2 > >> > >> OK. I'll close the SR, as well, and if this takes a while, I'll reopen > >> another. > >> > >> George > >> > >>> George, > >>> > >>> Thanks very much for your follow-up -- I've been beating my head > >>> against > >>> a wall for a week... I'll create a stripped down example that leaks > >>> and > >>> send it to you shortly. > >>> > >>> Best Regards, > >>> Ravi > >>> > >>>> -----Original Message----- > >>>> From: George Feinberg [mailto:george.feinberg@oracle.com] > >>>> Sent: Thursday, April 06, 2006 6:45 PM > >>>> To: Ravi Sakaria > >>>> Subject: Re: [bdbxml] Memory leak - DbXml 2.2 > >>>> > >>>> > >>>> Ravi, > >>>> > >>>> What does the leaking code look like? > >>>> > >>>> George > >>>> > >>>>>> -----Original Message----- > >>>>>> From: George Feinberg [mailto:george.feinberg@oracle.com] > >>>>>> Sent: Thursday, April 06, 2006 5:20 PM > >>>>>> To: Ravi Sakaria > >>>>>> Cc: Ravi; xml@sleepycat.com > >>>>>> Subject: Re: [bdbxml] Memory leak - DbXml 2.2 > >>>>>> > >>>>>> Just to be clear. Static class members are not instantiated > >>>>>> with class instances, so it's only ever the 32-bits that > >>>>>> are allocated. > >>>>>> > >>>>>> That said, I don't like the fact that this occurs -- at a minimum, > >>>>>> it's a distraction, and I may make some changes that will > >>>>>> eliminate this issue. > >>>>> [Ravi Sakaria] > >>>>> George, > >>>>> > >>>>> This is actually part of a larger problem that I'm trying to get to > >>>>> the bottom of... > >>>>> > >>>>> I also use some classes that were auto-generated with the > >>>>> CodeSynthesis > >>>>> XSD application (www.codesynthesis.com). When I instantiate one of > >>>>> these classes *after* opening the dbxml handle (as in the sample code > >>>>> below), the test program "definitely leaks 80 bytes". But when I > >>>>> do it without opening the dbxml handle, it doesn't leak at all. > >>>>> > >>>>> Also, if I open the dbxml handle inside curly brackets so it goes > >>>>> out of scope before the XSD class instantiation, there is no leak. > >>>>> > >>>>> I'm still trying to figure out how the two operations are stepping on > >>>>> each other. > >>>>> > >>>>> -- Ravi -------------- 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/20060413/1ae65bc1/attachment.pgp From kevin at wooten.com Sat Apr 15 20:57:05 2006 From: kevin at wooten.com (Kevin Wooten) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] cpp-parser nested elements/attributes Message-ID: <44419661.5080303@wooten.com> I have either misunderstood how to setup a cpp-parser or it seems to be quite broken. During parsing, the "event_router" object will search the tree starting at the root element and traverse downwards through the current scope, each time a new element starts. This means that elements and attributes with the same names are always handled incorrectly in elements above them in the scope. Here is an example: ---- Schema ---- ----- XML ----- In this case when starting the first "sub" element the event router will ask "test" if it can start the element. It can and does. When the second sub element is started, the event_router again ask the "test" element if it can start the "sub" element. It can and does, totally screwing the parsing. What it needs to do is ask only the current scope if it can start "sub" element, since it is the only valid place to start a new element in. To demonstrate how it will work 'sometimes', when starting the "sub2" element, the event_router still does the incorrect thing, but since "test" cannot start a "sub2" element, it continues trying the first "sub" element which succeeds. It is at this time you will see the attribute problem, because attributes are handled in the same way as elements. All the "name" attributes in this example will be handled by the "test" element parser. From boris at codesynthesis.com Sun Apr 16 12:43:32 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] cpp-parser nested elements/attributes In-Reply-To: <44419661.5080303@wooten.com> References: <44419661.5080303@wooten.com> Message-ID: <20060416164332.GA32030@karelia> Hi Kevin, Kevin Wooten writes: > I have either misunderstood how to setup a cpp-parser or it seems to be > quite broken. It is the latter. I wrote a small test based on your schema and instance and it confirms that the current release does handle this case properly. Accidently ;-) we've re-designed the internals quite a bit for the next release and this happened to fix the problem. The following test: #include #include #include "test.hxx" using std::cerr; using std::endl; using std::string; struct Sub_parser: Sub { virtual void pre () { cerr << "Sub::pre" << endl; } virtual void sub () { cerr << "Sub::sub" << endl; } virtual void sub2 () { cerr << "Sub::sub2" << endl; } virtual void name (string const& n) { cerr << "Sub::name: " << n << endl; } virtual void post () { cerr << "Sub::post" << endl; } }; struct Test_parser: Test { virtual void pre () { cerr << "Test::pre" << endl; } virtual void sub () { cerr << "Test::sub" << endl; } virtual void name (string const& n) { cerr << "Test::name: " << n << endl; } virtual void post () { cerr << "Test::post" << endl; } }; int main (int argc, char* argv[]) { if (argc != 2) { cerr << "usage: " << argv[0] << " test.xml" << endl; return 1; } try { xml_schema::string string_p; Sub_parser sub_p; Test_parser test_p; sub_p.parsers (sub_p, sub_p, string_p); test_p.parsers (sub_p, string_p); test_p._parse (argv[1], "", "test"); } catch (xml_schema::exception const& e) { cerr << e << endl; return 1; } catch (std::ios_base::failure const&) { cerr << "io failure" << endl; return 1; } } prints the following on the XML instance you provided: Test::pre Test::name: testName Sub::pre Sub::name: subName Sub::pre Sub::name: nestedName Sub::post Sub::sub Sub::pre Sub::name: sub2Name Sub::post Sub::sub2 Sub::post Test::sub Test::post which I think is the expected behavior. We are hoping to release 2.1.0 in the next couple of days. If you would like to try the fix before that, please let me know and I will build you a pre-release binary. Thanks for reporting this! -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060416/afc02d8e/attachment.pgp From boris at codesynthesis.com Tue Apr 18 06:20:22 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] xsd 2.1.0 released Message-ID: <20060418102022.GC12692@karelia> Good day, We've released xsd 2.1.0. The NEWS file entries for this version are as follows: * Automatic handling of forward inheritance. XML Schema allows inheritance from yet undefined types while it is illegal to do so in C++. Now the translator automatically handles forward inheritance by re-arranging the schema during compilation. C++/Tree * New enum mapping with support for inheritance. Enumerators are now parsed using binary search instead of linear search. * Associated DOM nodes now retain "back" pointers to tree nodes. * Optimizations to reduce generated code size. C++/Parser * Specialization for void. You can now use void as a hook argument type if you don't want to pass any data between parsers. * Support for re-use of implementations of base parsers in derived parsers using the mix-in C++ idiom. See the examples/cxx/parser/mix-in for more information. * Support for uninitialized parser. If you don't provide a parser for element/attribute, that element/attribute will be ignored during parsing. In addition to this, a number of bugs have been fixed. Thanks to the following individuals for reporting bugs and/or suggesting fixes and improvements: Thomas M?ller Frederic Heem Oliver Kowalke Ravi Sakaria Kevin Wooten Precompiled binary distributions for various platforms are available from the product's download page: http://codesynthesis.com/products/xsd/download.xhtml Source code for this release is available from the project's web page: http://codesynthesis.com/projects/xsd/ SHA1 checksums for the files: 0d8aa0505dfa2af6a6ee462a4c00240d7eacc945 xsd-2.1.0.tar.bz2 674918067cb26996c849eaf8059e83fe8c87b96c xsd_2.1.0-1_i386.deb 76afd438d5eccb6521ec82654778ba16701be4f1 xsd-2.1.0-1.i686.rpm 621b96088394dcffc0f65db3adf52d76ffdec098 xsd-2.1.0-i686-linux-gnu.tar.bz2 9170da5955e96a4225f4dd52394a24cca593a6d0 xsd_2.1.0-1_amd64.deb 96b76334a5ec49a13150b39fbac770711f052ab3 xsd-2.1.0-1.x86_64.rpm f03d92ca8970fd42d3806fc461a1fd059226e739 xsd-2.1.0-x86_64-linux-gnu.tar.bz2 705fd35c71578ea074a95ec5c22a6fda351fc1e2 xsd-2.1.0-hppa-hpux.tar.gz 494764ca904b2b9e5148ca06ddf55b9d6e1383f9 xsd-2.1.0-hppa-hpux.tar.bz2 97873cfb9302d0d3780e7a43bef28904e802289d xsd-2.1.0-powerpc-macosx.tar.bz2 7a466e1ccdc7ce6d28442ec553e4374864a9e550 xsd-2.1.0-sparc-solaris.tar.gz 2a6d06293a3058a61b7c6fb1cdc7eaf3058c4783 xsd-2.1.0-sparc-solaris.tar.bz2 3edca974a8f0fc2065e160c6d5979f72d5db61c0 xsd-2.1.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/20060418/9a2d81cb/attachment.pgp From boris at codesynthesis.com Thu Apr 20 06:08:50 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] Build instructions for Windows Message-ID: <20060420100850.GB18314@karelia> Good day, A step-by-step guide on how to build a native xsd binary for Windows from the source is now available at: http://codesynthesis.com/projects/xsd/extras/build-windows.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/20060420/c5c9f938/attachment.pgp From andy.ward at hevday.com Wed Apr 26 21:11:04 2006 From: andy.ward at hevday.com (Andrew Ward) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] Compilation Error Message-ID: <44501A28.8000705@hevday.com> Hi All, Using this schema: And using this command: xsd cxx-tree --generate-serialization --hxx-suffix .h --cxx-suffix .cpp s.xsd I get the following compilation errors when trying to compile the XSD generated code: s.cpp s.cpp(852) : error C2450: switch expression of type 'TopOrBottomType' is illegal Ambiguous user-defined-conversion s.cpp(872) : error C2450: switch expression of type 'TopOrBottomType' is illegal Ambiguous user-defined-conversion s.cpp(892) : error C2450: switch expression of type 'TopOrBottomType' is illegal Ambiguous user-defined-conversion Generating Code... NMAKE : fatal error U1077: 'cl' : return code '0x2' The code that the compiler is complaining about is here: void operator<< (::xsd::cxx::xml::dom::element< char >& n, class TopOrBottomType i) { switch (i) { case TopOrBottomType::top: { n.value ("top"); break; } case TopOrBottomType::bottom: { n.value ("bottom"); break; } } } void operator<< (::xsd::cxx::xml::dom::attribute< char >& n, class TopOrBottomType i) { switch (i) { case TopOrBottomType::top: { n.value ("top"); break; } case TopOrBottomType::bottom: { n.value ("bottom"); break; } } } void operator<< (::xsd::cxx::xml::dom::list_stream< char >& l, class TopOrBottomType i) { switch (i) { case TopOrBottomType::top: { l << "top"; break; } case TopOrBottomType::bottom: { l << "bottom"; break; } } } Any ideas anyone? Thanks. From andy.ward at hevday.com Wed Apr 26 17:53:49 2006 From: andy.ward at hevday.com (Andrew Ward) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] Lint errors Message-ID: <444FEBED.5040105@hevday.com> Hello, I am currently evaluating XSD and have run the generated C++ code from your hello.xsd example (http://codesynthesis.com/projects/xsd/documentation/cxx/tree/quick-guide/hello.xsd) through PC_Lint. I get a few C++ syntactic errors with the generated code. My question is, what are the feelings towards these errors, do they pose a problem, and are they likely to be fixed? Here is the Lint output: Descriptions for the error numbers can be found here: http://www.gimpel.com/html/pub/msg.txt --- Module: hello.cxx (C++) _ greeting::type& hello.hxx(227) : Error 1040: Symbol 'hello_type::greeting::type' is not a legal declaration within class 'hello_type' hello.hxx(227) : Warning 601: No explicit type for symbol 'hello_type::greeting::type', int assumed hello.hxx(227) : Error 36: redefining the storage class of symbol 'hello_type::greeting::type' (member of structure vs. type), conflicts with line 220 hello.hxx(220) : Info 830: Location cited in prior message _ greeting::type& hello.hxx(227) : Error 10: Expecting ';' _ greeting (greeting::type const&); hello.hxx(231) : Error 40: Undeclared identifier 'greeting' hello.hxx(231) : Error 1001: Scope 'greeting' must be a struct or class name hello.hxx(231) : Error 40: Undeclared identifier 'type' hello.hxx(231) : Warning 601: No explicit type for symbol '', int assumed _ greeting (::std::auto_ptr< greeting::type >); hello.hxx(234) : Error 40: Undeclared identifier 'greeting' hello.hxx(234) : Error 1001: Scope 'greeting' must be a struct or class name hello.hxx(234) : Error 151: Token 'type' inconsistent with abstract type hello.hxx(234) : Error 1054: template variable declaration expects a type, int assumed _ name::container& hello.hxx(251) : Error 1040: Symbol 'hello_type::name::container' is not a legal declaration within class 'hello_type' hello.hxx(251) : Warning 601: No explicit type for symbol 'hello_type::name::container', int assumed hello.hxx(251) : Error 36: redefining the storage class of symbol 'hello_type::name::container' (member of structure vs. type), conflicts with line 243 hello.hxx(243) : Info 830: Location cited in prior message _ name::container& hello.hxx(251) : Error 10: Expecting ';' _ name (name::container const&); hello.hxx(255) : Error 40: Undeclared identifier 'name' hello.hxx(255) : Error 1001: Scope 'name' must be a struct or class name hello.hxx(255) : Error 40: Undeclared identifier 'container' hello.hxx(255) : Warning 601: No explicit type for symbol '', int assumed _ hello_type (greeting::type const&); hello.hxx(260) : Error 1040: Symbol 'hello_type::greeting::type' is not a legal declaration within class 'hello_type' hello.hxx(260) : Error 10: Expecting ')' _ ::xsd::cxx::tree::type* = 0) const; hello.hxx(272) : Info 1735: Virtual function 'hello_type::_clone(xsd::cxx::tree::flags, xsd::cxx::tree::_type *) const' has default parameter -- Effective C++ #38 _ ::xsd::cxx::tree::one_functor< greeting::type > _xsd_greeting_; hello.hxx(281) : Error 40: Undeclared identifier 'greeting' hello.hxx(281) : Error 1001: Scope 'greeting' must be a struct or class name hello.hxx(281) : Error 151: Token 'type' inconsistent with abstract type hello.hxx(281) : Error 1054: template variable declaration expects a type, int assumed hello.hxx(281) : Error 40: Undeclared identifier 'greeting' hello.hxx(281) : Error 1001: Scope 'greeting' must be a struct or class name hello.hxx(281) : Error 151: Token 'type' inconsistent with abstract type hello.hxx(281) : Error 1054: template variable declaration expects a type, int assumed _ ::xsd::cxx::tree::sequence_functor< name::type > _xsd_name_; hello.hxx(282) : Error 40: Undeclared identifier 'name' hello.hxx(282) : Error 1001: Scope 'name' must be a struct or class name hello.hxx(282) : Error 151: Token 'type' inconsistent with abstract type hello.hxx(282) : Error 1054: template variable declaration expects a type, int assumed hello.hxx(282) : Error 40: Undeclared identifier 'name' hello.hxx(282) : Error 1001: Scope 'name' must be a struct or class name hello.hxx(282) : Error 151: Token 'type' inconsistent with abstract type hello.hxx(282) : Error 1054: template variable declaration expects a type, int assumed _ hello_type::greeting::type const& hello_type:: hello.cxx(45) : Error 1015: Symbol 'greeting' not found in class hello.cxx(45) : Error 1001: Scope 'greeting' must be a struct or class name hello.cxx(45) : Error 129: declaration expected, identifier 'type' ignored _ { hello.cxx(47) : Info 808: No explicit type given symbol 'hello_type::greeting(void) const', int assumed hello.cxx(47) : Error 18: Symbol 'hello_type::greeting(void) const' redeclared (basic) conflicts with line 224, file hello.hxx hello.hxx(224) : Info 830: Location cited in prior message _ hello_type::greeting::type& hello_type:: hello.cxx(51) : Error 1015: Symbol 'greeting' not found in class hello.cxx(51) : Error 1001: Scope 'greeting' must be a struct or class name hello.cxx(51) : Error 129: declaration expected, identifier 'type' ignored _ { hello.cxx(53) : Error 1039: Symbol 'hello_type::greeting(void)' is not a member of class 'hello_type' hello.cxx(53) : Info 745: function 'hello_type::greeting(void)' has no explicit type or class, int assumed hello.cxx(53) : Error 18: Symbol 'hello_type::greeting(void)' redeclared (basic) conflicts with location unknown _ return this->_xsd_greeting_ (); hello.cxx(54) : Error 1003: 'this' may not be used in a static member function _ greeting (greeting::type const& greeting) hello.cxx(58) : Error 110: Attempt to assign to void hello.cxx(58) : Warning 530: Symbol 'type' (location unknown) not initialized hello.cxx(58) : Error 10: Expecting ')' _ { hello.cxx(59) : Error 10: Expecting ';' _ greeting (::std::auto_ptr< greeting::type > greeting) hello.cxx(64) : Error 40: Undeclared identifier 'greeting' hello.cxx(64) : Error 1001: Scope 'greeting' must be a struct or class name hello.cxx(64) : Error 151: Token 'type' inconsistent with abstract type hello.cxx(64) : Error 1054: template variable declaration expects a type, int assumed hello.cxx(64) : Error 40: Undeclared identifier 'greeting' hello.cxx(64) : Error 1001: Scope 'greeting' must be a struct or class name hello.cxx(64) : Error 151: Token 'type' inconsistent with abstract type hello.cxx(64) : Error 1054: template variable declaration expects a type, int assumed _ { hello.cxx(65) : Info 745: function 'hello_type::greeting(std::auto_ptr)' has no explicit type or class, int assumed hello.cxx(65) : Error 18: Symbol 'hello_type::greeting(std::auto_ptr)' redeclared (basic) conflicts with line 234, file hello.hxx hello.hxx(234) : Info 830: Location cited in prior message _ } hello.cxx(67) : Warning 533: function 'hello_type::greeting(std::auto_ptr)' should return a value (see line 63) hello.cxx(63) : Info 830: Location cited in prior message _ } hello.cxx(67) : Warning 529: Symbol 'type' (location unknown) not subsequently referenced _ hello_type::name::container const& hello_type:: hello.cxx(69) : Error 1015: Symbol 'name' not found in class hello.cxx(69) : Error 1001: Scope 'name' must be a struct or class name hello.cxx(69) : Error 129: declaration expected, identifier 'container' ignored _ { hello.cxx(71) : Info 808: No explicit type given symbol 'hello_type::name(void) const', int assumed hello.cxx(71) : Error 18: Symbol 'hello_type::name(void) const' redeclared (basic) conflicts with line 248, file hello.hxx hello.hxx(248) : Info 830: Location cited in prior message _ return this->_xsd_name_ (); hello.cxx(72) : Error 64: Type mismatch (return) (int = struct) _ hello_type::name::container& hello_type:: hello.cxx(75) : Error 1015: Symbol 'name' not found in class hello.cxx(75) : Error 1001: Scope 'name' must be a struct or class name hello.cxx(75) : Error 129: declaration expected, identifier 'container' ignored _ { hello.cxx(77) : Error 1039: Symbol 'hello_type::name(void)' is not a member of class 'hello_type' hello.cxx(77) : Info 745: function 'hello_type::name(void)' has no explicit type or class, int assumed hello.cxx(77) : Error 18: Symbol 'hello_type::name(void)' redeclared (basic) conflicts with location unknown _ return this->_xsd_name_ (); hello.cxx(78) : Error 1003: 'this' may not be used in a static member function hello.cxx(78) : Warning 1514: Creating temporary to copy 'xsd::cxx::tree::sequence &' to 'int &' (context: return) hello.cxx(78) : Error 64: Type mismatch (return) (int = struct) _ name (name::container const& name) hello.cxx(82) : Error 110: Attempt to assign to void hello.cxx(82) : Warning 530: Symbol 'container' (location unknown) not initialized hello.cxx(82) : Error 10: Expecting ')' _ { hello.cxx(83) : Error 10: Expecting ';' _ hello_type (greeting::type const& _xsd_greeting) hello.cxx(98) : Error 110: Attempt to assign to void hello.cxx(98) : Error 10: Expecting ')' _ : ::xsd::cxx::tree::type (), hello.cxx(99) : Error 10: Expecting ';' _ hello_type (::xsd::cxx::xml::dom::element< char > const& e, hello.cxx(120) : Error 31: Redefinition of symbol 'hello_type::hello_type' compare with line 98 hello.cxx(98) : Info 830: Location cited in prior message _ hello_type (::xsd::cxx::xml::dom::element< char > const& e, hello.cxx(120) : Error 78: Symbol 'xsd::cxx::xml::dom::element' typedef'ed at line 195, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(195) : Info 830: Location cited in prior message _ hello_type (::xsd::cxx::xml::dom::element< char > const& e, hello.cxx(120) : Error 110: Attempt to assign to void hello.cxx(120) : Warning 530: Symbol 'xsd::cxx::xml::dom::element' (line 195, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx) not initialized C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(195) : Info 830: Location cited in prior message _ hello_type (::xsd::cxx::xml::dom::element< char > const& e, hello.cxx(120) : Error 10: Expecting ')' _ : ::xsd::cxx::tree::type (e, f, c), hello.cxx(123) : Error 10: Expecting ';' _ _clone (::xsd::cxx::tree::flags f, hello.cxx(132) : Error 78: Symbol 'xsd::cxx::tree::flags' typedef'ed at line 29, file C:\xsd\libxsd\xsd\cxx\tree\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\tree\elements.hxx(29) : Info 830: Location cited in prior message _ _clone (::xsd::cxx::tree::flags f, hello.cxx(132) : Error 64: Type mismatch (initialization) (hello_type * = xsd::cxx::tree::flags) hello.cxx(132) : Warning 530: Symbol 'xsd::cxx::tree::flags' (line 29, file C:\xsd\libxsd\xsd\cxx\tree\elements.hxx) not initialized C:\xsd\libxsd\xsd\cxx\tree\elements.hxx(29) : Info 830: Location cited in prior message _ _clone (::xsd::cxx::tree::flags f, hello.cxx(132) : Error 10: Expecting ')' _ ::xsd::cxx::tree::type* c) const hello.cxx(133) : Error 10: Expecting ';' _ parse (::xsd::cxx::xml::dom::element< char > const& e, hello.cxx(139) : Error 129: declaration expected, identifier 'hello_type::parse' ignored hello.cxx(139) : Error 129: declaration expected, identifier 'xsd::cxx::xml::dom::element' ignored hello.cxx(139) : Info 808: No explicit type given symbol 'e', int assumed hello.cxx(139) : Error 1072: Reference variable 'e' must be initialized _ ::xsd::cxx::tree::flags f) hello.cxx(140) : Info 808: No explicit type given symbol 'xsd::cxx::tree::flags', int assumed hello.cxx(140) : Error 10: Expecting ';' _ ::xsd::cxx::xml::dom::parser< char > p (e); hello.cxx(142) : Error 40: Undeclared identifier 'parser' hello.cxx(142) : Error 26: Expected an expression, found '<' hello.cxx(142) : Error 10: Expecting '}' _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(203) : Error 78: Symbol 'xsd::cxx::xml::auto_initializer' typedef'ed at line 129, file C:\xsd\libxsd\xsd\cxx\xml\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\elements.hxx(129) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(203) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(203) : Error 10: Expecting ';' _ ::xsd::cxx::tree::error_handler< char > h; hello.cxx(207) : Error 40: Undeclared identifier 'error_handler' hello.cxx(207) : Error 26: Expected an expression, found '<' hello.cxx(207) : Error 10: Expecting '(' hello.cxx(207) : Warning 522: Expected void type, assignment, increment or decrement _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(209) : Error 78: Symbol 'xsd::cxx::xml::dom::auto_ptr' typedef'ed at line 54, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(54) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(209) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(209) : Error 10: Expecting ';' _ h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > (); hello.cxx(213) : Error 40: Undeclared identifier 'h' hello.cxx(213) : Error 10: Expecting a structure or union hello.cxx(213) : Error 1013: Symbol 'throw_if_failed' not a member of class '' hello.cxx(213) : Error 40: Undeclared identifier 'throw_if_failed' hello.cxx(213) : Error 78: Symbol 'xsd::cxx::tree::parsing' typedef'ed at line 102, file C:\xsd\libxsd\xsd\cxx\tree\exceptions.hxx used in expression C:\xsd\libxsd\xsd\cxx\tree\exceptions.hxx(102) : Info 830: Location cited in prior message _ h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > (); hello.cxx(213) : Error 55: Bad type hello.cxx(213) : Error 26: Expected an expression, found ')' hello.cxx(213) : Warning 503: Boolean argument to relational hello.cxx(213) : Warning 530: Symbol 'xsd::cxx::tree::parsing' (line 102, file C:\xsd\libxsd\xsd\cxx\tree\exceptions.hxx) not initialized C:\xsd\libxsd\xsd\cxx\tree\exceptions.hxx(102) : Info 830: Location cited in prior message _ h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > (); hello.cxx(213) : Warning 522: Expected void type, assignment, increment or decrement _ static_cast< ::xercesc::DOMDocument const& > (*d), f); hello.cxx(216) : Error 40: Undeclared identifier 'd' hello.cxx(216) : Error 40: Undeclared identifier 'd' _ } hello.cxx(217) : Info 715: Symbol 'p' (line 201) not referenced hello.cxx(201) : Info 830: Location cited in prior message _ } hello.cxx(217) : Info 715: Symbol 'u' (line 199) not referenced hello.cxx(199) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(225) : Error 78: Symbol 'xsd::cxx::xml::auto_initializer' typedef'ed at line 129, file C:\xsd\libxsd\xsd\cxx\xml\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\elements.hxx(129) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(225) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(225) : Error 10: Expecting ';' _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(229) : Error 78: Symbol 'xsd::cxx::xml::dom::auto_ptr' typedef'ed at line 54, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(54) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(229) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(229) : Error 10: Expecting ';' _ if (!d) hello.cxx(233) : Error 40: Undeclared identifier 'd' _ static_cast< ::xercesc::DOMDocument const& > (*d), f); hello.cxx(239) : Error 40: Undeclared identifier 'd' hello.cxx(239) : Error 40: Undeclared identifier 'd' _ } hello.cxx(240) : Info 715: Symbol 'p' (line 223) not referenced hello.cxx(223) : Info 830: Location cited in prior message _ } hello.cxx(240) : Info 715: Symbol 'u' (line 220) not referenced hello.cxx(220) : Info 830: Location cited in prior message _ } hello.cxx(240) : Info 715: Symbol 'h' (line 221) not referenced hello.cxx(221) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(248) : Error 78: Symbol 'xsd::cxx::xml::dom::auto_ptr' typedef'ed at line 54, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(54) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(248) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(248) : Error 10: Expecting ';' _ if (!d) hello.cxx(252) : Error 40: Undeclared identifier 'd' _ static_cast< ::xercesc::DOMDocument const& > (*d), f); hello.cxx(258) : Error 40: Undeclared identifier 'd' hello.cxx(258) : Error 40: Undeclared identifier 'd' _ } hello.cxx(259) : Info 715: Symbol 'p' (line 246) not referenced hello.cxx(246) : Info 830: Location cited in prior message _ } hello.cxx(259) : Info 715: Symbol 'u' (line 243) not referenced hello.cxx(243) : Info 830: Location cited in prior message _ } hello.cxx(259) : Info 715: Symbol 'h' (line 244) not referenced hello.cxx(244) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(266) : Error 78: Symbol 'xsd::cxx::xml::auto_initializer' typedef'ed at line 129, file C:\xsd\libxsd\xsd\cxx\xml\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\elements.hxx(129) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(266) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(266) : Error 10: Expecting ';' _ ::xsd::cxx::xml::sax::std_input_source isrc (is); hello.cxx(270) : Error 40: Undeclared identifier 'sax' hello.cxx(270) : Error 1001: Scope 'sax' must be a struct or class name hello.cxx(270) : Error 40: Undeclared identifier 'std_input_source' hello.cxx(270) : Error 1055: Symbol 'isrc' undeclared, assumed to return int hello.cxx(270) : Info 746: call to function 'isrc()' not made in the presence of a prototype _ xercesc::Wrapper4InputSource wrap (&isrc, false); hello.cxx(271) : Error 40: Undeclared identifier 'Wrapper4InputSource' hello.cxx(271) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(271) : Error 10: Expecting ';' _ return ::hello (wrap, f, p); hello.cxx(272) : Error 40: Undeclared identifier 'wrap' hello.cxx(272) : Error 1025: No function matches invocation 'hello(const int, xsd::cxx::tree::flags, const xsd::cxx::tree::properties)', 13 candidates found, 13 matched the argument count, none matched on arg. no. 1 hello.cxx(272) : Info 1703: Function 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' arbitrarily selected. Refer to Error 1025 hello.cxx(272) : Error 40: Undeclared identifier 'wrap' _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(281) : Error 78: Symbol 'xsd::cxx::xml::auto_initializer' typedef'ed at line 129, file C:\xsd\libxsd\xsd\cxx\xml\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\elements.hxx(129) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(281) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(281) : Error 10: Expecting ';' _ ::xsd::cxx::xml::sax::std_input_source isrc (is); hello.cxx(285) : Error 40: Undeclared identifier 'sax' hello.cxx(285) : Error 1001: Scope 'sax' must be a struct or class name hello.cxx(285) : Error 40: Undeclared identifier 'std_input_source' _ xercesc::Wrapper4InputSource wrap (&isrc, false); hello.cxx(286) : Error 40: Undeclared identifier 'Wrapper4InputSource' hello.cxx(286) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(286) : Error 10: Expecting ';' _ return ::hello (wrap, h, f, p); hello.cxx(287) : Error 40: Undeclared identifier 'wrap' hello.cxx(287) : Error 1025: No function matches invocation 'hello(const int, xsd::cxx::xml::error_handler, xsd::cxx::tree::flags, const xsd::cxx::tree::properties)', 13 candidates found, 9 matched the argument count, none matched on arg. no. 1 hello.cxx(287) : Info 1703: Function 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' arbitrarily selected. Refer to Error 1025 hello.cxx(287) : Error 40: Undeclared identifier 'wrap' hello.cxx(287) : Error 64: Type mismatch (arg. no. 2) (xsd::cxx::tree::flags = xsd::cxx::xml::error_handler &) hello.cxx(287) : Error 64: Type mismatch (arg. no. 3) (xsd::cxx::tree::properties = xsd::cxx::tree::flags) hello.cxx(287) : Error 119: Too many arguments (4) for prototype 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' _ ::xsd::cxx::xml::sax::std_input_source isrc (is); hello.cxx(296) : Error 40: Undeclared identifier 'sax' hello.cxx(296) : Error 1001: Scope 'sax' must be a struct or class name hello.cxx(296) : Error 40: Undeclared identifier 'std_input_source' _ xercesc::Wrapper4InputSource wrap (&isrc, false); hello.cxx(297) : Error 40: Undeclared identifier 'Wrapper4InputSource' hello.cxx(297) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(297) : Error 10: Expecting ';' _ return ::hello (wrap, h, f, p); hello.cxx(298) : Error 40: Undeclared identifier 'wrap' hello.cxx(298) : Error 1025: No function matches invocation 'hello(const int, xercesc_2_7::DOMErrorHandler, xsd::cxx::tree::flags, const xsd::cxx::tree::properties)', 13 candidates found, 9 matched the argument count, none matched on arg. no. 1 hello.cxx(298) : Info 1703: Function 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' arbitrarily selected. Refer to Error 1025 hello.cxx(298) : Error 40: Undeclared identifier 'wrap' hello.cxx(298) : Error 64: Type mismatch (arg. no. 2) (xsd::cxx::tree::flags = xercesc_2_7::DOMErrorHandler &) hello.cxx(298) : Error 64: Type mismatch (arg. no. 3) (xsd::cxx::tree::properties = xsd::cxx::tree::flags) hello.cxx(298) : Error 119: Too many arguments (4) for prototype 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(307) : Error 78: Symbol 'xsd::cxx::xml::auto_initializer' typedef'ed at line 129, file C:\xsd\libxsd\xsd\cxx\xml\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\elements.hxx(129) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(307) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(307) : Error 10: Expecting ';' _ ::xsd::cxx::xml::sax::std_input_source isrc (is, sid); hello.cxx(311) : Error 40: Undeclared identifier 'sax' hello.cxx(311) : Error 1001: Scope 'sax' must be a struct or class name hello.cxx(311) : Error 40: Undeclared identifier 'std_input_source' hello.cxx(311) : Warning 515: Symbol 'isrc()' has arg. count conflict (2 vs. 1) with line 270 hello.cxx(270) : Info 830: Location cited in prior message _ xercesc::Wrapper4InputSource wrap (&isrc, false); hello.cxx(312) : Error 40: Undeclared identifier 'Wrapper4InputSource' hello.cxx(312) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(312) : Error 10: Expecting ';' _ return ::hello (wrap, f, p); hello.cxx(313) : Error 40: Undeclared identifier 'wrap' hello.cxx(313) : Error 1025: No function matches invocation 'hello(const int, xsd::cxx::tree::flags, const xsd::cxx::tree::properties)', 13 candidates found, 13 matched the argument count, none matched on arg. no. 1 hello.cxx(313) : Info 1703: Function 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' arbitrarily selected. Refer to Error 1025 hello.cxx(313) : Error 40: Undeclared identifier 'wrap' _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(323) : Error 78: Symbol 'xsd::cxx::xml::auto_initializer' typedef'ed at line 129, file C:\xsd\libxsd\xsd\cxx\xml\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\elements.hxx(129) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::auto_initializer i ( hello.cxx(323) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(323) : Error 10: Expecting ';' _ ::xsd::cxx::xml::sax::std_input_source isrc (is, sid); hello.cxx(327) : Error 40: Undeclared identifier 'sax' hello.cxx(327) : Error 1001: Scope 'sax' must be a struct or class name hello.cxx(327) : Error 40: Undeclared identifier 'std_input_source' hello.cxx(327) : Warning 515: Symbol 'isrc()' has arg. count conflict (2 vs. 1) with line 270 hello.cxx(270) : Info 830: Location cited in prior message _ xercesc::Wrapper4InputSource wrap (&isrc, false); hello.cxx(328) : Error 40: Undeclared identifier 'Wrapper4InputSource' hello.cxx(328) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(328) : Error 10: Expecting ';' _ return ::hello (wrap, h, f, p); hello.cxx(329) : Error 40: Undeclared identifier 'wrap' hello.cxx(329) : Error 1025: No function matches invocation 'hello(const int, xsd::cxx::xml::error_handler, xsd::cxx::tree::flags, const xsd::cxx::tree::properties)', 13 candidates found, 9 matched the argument count, none matched on arg. no. 1 hello.cxx(329) : Info 1703: Function 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' arbitrarily selected. Refer to Error 1025 hello.cxx(329) : Error 40: Undeclared identifier 'wrap' hello.cxx(329) : Error 64: Type mismatch (arg. no. 2) (xsd::cxx::tree::flags = xsd::cxx::xml::error_handler &) hello.cxx(329) : Error 64: Type mismatch (arg. no. 3) (xsd::cxx::tree::properties = xsd::cxx::tree::flags) hello.cxx(329) : Error 119: Too many arguments (4) for prototype 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' _ ::xsd::cxx::xml::sax::std_input_source isrc (is, sid); hello.cxx(339) : Error 40: Undeclared identifier 'sax' hello.cxx(339) : Error 1001: Scope 'sax' must be a struct or class name hello.cxx(339) : Error 40: Undeclared identifier 'std_input_source' hello.cxx(339) : Warning 515: Symbol 'isrc()' has arg. count conflict (2 vs. 1) with line 270 hello.cxx(270) : Info 830: Location cited in prior message _ xercesc::Wrapper4InputSource wrap (&isrc, false); hello.cxx(340) : Error 40: Undeclared identifier 'Wrapper4InputSource' hello.cxx(340) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(340) : Error 10: Expecting ';' _ return ::hello (wrap, h, f, p); hello.cxx(341) : Error 40: Undeclared identifier 'wrap' hello.cxx(341) : Error 1025: No function matches invocation 'hello(const int, xercesc_2_7::DOMErrorHandler, xsd::cxx::tree::flags, const xsd::cxx::tree::properties)', 13 candidates found, 9 matched the argument count, none matched on arg. no. 1 hello.cxx(341) : Info 1703: Function 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' arbitrarily selected. Refer to Error 1025 hello.cxx(341) : Error 40: Undeclared identifier 'wrap' hello.cxx(341) : Error 64: Type mismatch (arg. no. 2) (xsd::cxx::tree::flags = xercesc_2_7::DOMErrorHandler &) hello.cxx(341) : Error 64: Type mismatch (arg. no. 3) (xsd::cxx::tree::properties = xsd::cxx::tree::flags) hello.cxx(341) : Error 119: Too many arguments (4) for prototype 'hello(const std::basic_string,std::allocator> &, xsd::cxx::tree::flags, const xsd::cxx::tree::properties &)' _ ::xsd::cxx::tree::error_handler< char > h; hello.cxx(349) : Error 40: Undeclared identifier 'error_handler' hello.cxx(349) : Error 26: Expected an expression, found '<' hello.cxx(349) : Error 10: Expecting '(' hello.cxx(349) : Warning 522: Expected void type, assignment, increment or decrement _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(351) : Error 78: Symbol 'xsd::cxx::xml::dom::auto_ptr' typedef'ed at line 54, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(54) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(351) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(351) : Error 10: Expecting ';' _ h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > (); hello.cxx(355) : Error 40: Undeclared identifier 'h' hello.cxx(355) : Error 10: Expecting a structure or union hello.cxx(355) : Error 1013: Symbol 'throw_if_failed' not a member of class '' hello.cxx(355) : Error 40: Undeclared identifier 'throw_if_failed' hello.cxx(355) : Error 78: Symbol 'xsd::cxx::tree::parsing' typedef'ed at line 102, file C:\xsd\libxsd\xsd\cxx\tree\exceptions.hxx used in expression C:\xsd\libxsd\xsd\cxx\tree\exceptions.hxx(102) : Info 830: Location cited in prior message _ h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > (); hello.cxx(355) : Error 55: Bad type hello.cxx(355) : Error 26: Expected an expression, found ')' hello.cxx(355) : Warning 503: Boolean argument to relational hello.cxx(355) : Warning 522: Expected void type, assignment, increment or decrement _ static_cast< ::xercesc::DOMDocument const& > (*d), f, p); hello.cxx(358) : Error 40: Undeclared identifier 'd' hello.cxx(358) : Error 40: Undeclared identifier 'd' _ } hello.cxx(359) : Info 715: Symbol 'i' (line 345) not referenced hello.cxx(345) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(367) : Error 78: Symbol 'xsd::cxx::xml::dom::auto_ptr' typedef'ed at line 54, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(54) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(367) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(367) : Error 10: Expecting ';' _ if (!d) hello.cxx(371) : Error 40: Undeclared identifier 'd' _ static_cast< ::xercesc::DOMDocument const& > (*d), f, p); hello.cxx(377) : Error 40: Undeclared identifier 'd' hello.cxx(377) : Error 40: Undeclared identifier 'd' _ } hello.cxx(378) : Info 715: Symbol 'h' (line 363) not referenced hello.cxx(363) : Info 830: Location cited in prior message _ } hello.cxx(378) : Info 715: Symbol 'i' (line 362) not referenced hello.cxx(362) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(386) : Error 78: Symbol 'xsd::cxx::xml::dom::auto_ptr' typedef'ed at line 54, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(54) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d ( hello.cxx(386) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(386) : Error 10: Expecting ';' _ if (!d) hello.cxx(390) : Error 40: Undeclared identifier 'd' _ static_cast< ::xercesc::DOMDocument const& > (*d), f, p); hello.cxx(396) : Error 40: Undeclared identifier 'd' hello.cxx(396) : Error 40: Undeclared identifier 'd' _ } hello.cxx(397) : Info 715: Symbol 'h' (line 382) not referenced hello.cxx(382) : Info 830: Location cited in prior message _ } hello.cxx(397) : Info 715: Symbol 'i' (line 381) not referenced hello.cxx(381) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > c ( hello.cxx(404) : Error 78: Symbol 'xsd::cxx::xml::dom::auto_ptr' typedef'ed at line 54, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(54) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > c ( hello.cxx(404) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(404) : Error 10: Expecting ';' _ ::xsd::cxx::xml::dom::element< char > e ( hello.cxx(409) : Error 78: Symbol 'xsd::cxx::xml::dom::element' typedef'ed at line 195, file C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx used in expression C:\xsd\libxsd\xsd\cxx\xml\dom\elements.hxx(195) : Info 830: Location cited in prior message _ ::xsd::cxx::xml::dom::element< char > e ( hello.cxx(409) : Warning 522: Expected void type, assignment, increment or decrement hello.cxx(409) : Error 10: Expecting ';' _ if (e.name () == "hello" && e.namespace_ () == "") hello.cxx(412) : Error 10: Expecting a structure or union hello.cxx(412) : Error 1013: Symbol 'name' not a member of class '' hello.cxx(412) : Error 1055: Symbol 'name' undeclared, assumed to return int hello.cxx(412) : Info 746: call to function 'name()' not made in the presence of a prototype hello.cxx(412) : Info 779: String constant in comparison operator '==' hello.cxx(412) : Error 58: Bad type hello.cxx(412) : Error 10: Expecting a structure or union hello.cxx(412) : Error 1013: Symbol 'namespace_' not a member of class '' hello.cxx(412) : Error 1055: Symbol 'namespace_' undeclared, assumed to return int hello.cxx(412) : Info 746: call to function 'namespace_()' not made in the presence of a prototype hello.cxx(412) : Info 779: String constant in comparison operator '==' hello.cxx(412) : Error 58: Bad type _ ::std::auto_ptr< ::_xsd_hello_type::type > r (::xsd::cxx::tree::traits< ::_xsd_hello_type::type >::create (e, f, 0)); hello.cxx(414) : Error 1024: No function has same argument count as 'xsd::cxx::tree::traits::create(const int, xsd::cxx::tree::flags, int)', 4 candidates found hello.cxx(414) : Info 1703: Function 'xsd::cxx::tree::traits::create(const xsd::cxx::xml::dom::element<<1>> &, xsd::cxx::tree::flags, xsd::cxx::tree::_type *)' arbitrarily selected. Refer to Error 1024 hello.cxx(414) : Error 1024: No function has same argument count as 'xsd::cxx::tree::traits::create(const int, xsd::cxx::tree::flags, int)', 4 candidates found hello.cxx(414) : Info 1703: Function 'xsd::cxx::tree::traits::create(const xsd::cxx::xml::dom::element<<1>> &, xsd::cxx::tree::flags, xsd::cxx::tree::_type *)' arbitrarily selected. Refer to Error 1024 hello.cxx(414) : Error 1058: Initializing a non-const reference 'std::auto_ptr &' with a non-lvalue _ if (f & ::xsd::cxx::tree::flags::keep_dom) c.release (); hello.cxx(415) : Error 40: Undeclared identifier 'c' hello.cxx(415) : Error 10: Expecting a structure or union hello.cxx(415) : Error 1013: Symbol 'release' not a member of class '' hello.cxx(415) : Error 1055: Symbol 'release' undeclared, assumed to return int hello.cxx(415) : Info 746: call to function 'release()' not made in the presence of a prototype _ return r; hello.cxx(416) : Error 1058: Initializing a non-const reference 'std::auto_ptr &' with a non-lvalue _ e.name (), hello.cxx(420) : Error 10: Expecting a structure or union hello.cxx(420) : Error 1013: Symbol 'name' not a member of class '' _ e.namespace_ (), hello.cxx(421) : Error 10: Expecting a structure or union hello.cxx(421) : Error 1013: Symbol 'namespace_' not a member of class '' _ ""); hello.cxx(423) : Error 1025: No function matches invocation 'xsd::cxx::tree::unexpected_element::unexpected_element(const int, const int, const char[], const char[])', 2 candidates found, 1 matched the argument count, none matched on arg. no. 1 hello.cxx(423) : Info 1703: Function 'xsd::cxx::tree::unexpected_element::unexpected_element(const std::basic_string,std::allocator> &, const std::basic_string,std::allocator> &, const std::basic_string,std::allocator> &, const std::basic_string,std::allocator> &)' arbitrarily selected. Refer to Error 1025 _ e.name (), hello.cxx(420) : Error 10: Expecting a structure or union hello.cxx(420) : Error 1013: Symbol 'name' not a member of class '' hello.cxx(420) : Error 64: Type mismatch (arg. no. 1) (std::basic_string,std::allocator> = int) _ e.namespace_ (), hello.cxx(421) : Error 10: Expecting a structure or union hello.cxx(421) : Error 1013: Symbol 'namespace_' not a member of class '' hello.cxx(421) : Error 64: Type mismatch (arg. no. 2) (std::basic_string,std::allocator> = int) _ } hello.cxx(424) : Info 715: Symbol 'd' (line 400) not referenced hello.cxx(400) : Info 830: Location cited in prior message From boris at codesynthesis.com Thu Apr 27 11:55:29 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] Compilation Error In-Reply-To: <44501A28.8000705@hevday.com> References: <44501A28.8000705@hevday.com> Message-ID: <20060427155529.GA24983@karelia> Hi Andrew, Andrew Ward writes: > > > > > > > > > > > > > > > > > ... > > s.cpp > s.cpp(852) : error C2450: switch expression of type 'TopOrBottomType' is > illegal > Ambiguous user-defined-conversion That's a bug in the new enum mapping which was introduced in 2.1.0. Both TopOrBottomType and SideType define implicit conversion operators to underlying enum types. But since TopOrBottomType inherits SideType, there is ambiguity when trying to convert from TopOrBottomType. This will be fixed in 2.1.1, which should hopefully be out by Tue. For the meantime I have two workarounds for you: 1. Temporarily change your schema to not inherit one enum from the other. 2. Downgrade to 2.0.0. Thanks for reporting this! -boris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 652 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060427/44494ca8/attachment.pgp From boris at codesynthesis.com Thu Apr 27 12:18:58 2006 From: boris at codesynthesis.com (Boris Kolpackov) Date: Sun Oct 11 15:33:45 2009 Subject: [xsd-users] Lint errors In-Reply-To: <444FEBED.5040105@hevday.com> References: <444FEBED.5040105@hevday.com> Message-ID: <20060427161858.GB24983@karelia> Hi Andrew, Andrew Ward writes: > I get a few C++ syntactic errors with the generated code. > My question is, what are the feelings towards these errors Hm, those are strange errors. I tried to understand them (with help from msg.txt) but could not figure exactly what's wrong. Also none of the descriptions of messages in msg.txt refer to the C++ standard so it really becomes a "PC_Lint says it is illegal while GNU g++, Intel C++, Sun C++, HP aCC and MS VC++ all say it is legal" type of situation. You may want to write to PC_Lint vendor and ask them what exactly is wrong with the code (i.e., ask them to cite the standard). Honestly, I think that PC_Lint's C++ parser simply cannot parse modern C++. Have you tried it on some other C++ projects, say boost or your compiler's C++ standard library? > do they pose a problem It is hard to give definite answer without understanding what exactly PC_Link is complaining about. I, however, tend to think the answer is "No" since major C++ compilers think the code is perfectly valid, generate correct code which executes as expected. > and are they likely to be fixed? If somebody proposes a fix and the changes are not too extensive, we can consider making PC_Link happy ;-). 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/20060427/e43ad3d4/attachment.pgp