serialize to / from XML question

Hello, all ... I've successfully used the Boost serialization classes to read our config file, as well as write updates to it. It seems to work well enough, and i'm appreciative of the effort that someone put into making these classes work. My question, though, is about this: There is another XML file that we have to read, that is generated by a server process that we do not directly control. We're currently using TinyXML to read from this XML file, but we would like to replace its' usage with something Boosty. The thing is, the current Boost serialization classes seem to need some special tags and attributes in the XML (boost_serialization tag, class_id / tracking_level / version attributes) to read from it, and the server process which creates this XML file doesn't put those attributes in there (and we would prefer to not have the maintainers of that process make a change just for us). Is there another way I can use Boost to read from an XML, and fill an object with its' values (like the serialization classes do), without needing those special tags / attrbutes? Regards, John Falling You - exploring the beauty of voice and sound http://www.fallingyou.com

jmzorko@mac.com wrote:
Hello, all ...
I've successfully used the Boost serialization classes to read our config file, as well as write updates to it. It seems to work well enough, and i'm appreciative of the effort that someone put into making these classes work.
My question, though, is about this: There is another XML file that we have to read, that is generated by a server process that we do not directly control. We're currently using TinyXML to read from this XML file, but we would like to replace its' usage with something Boosty. The thing is, the current Boost serialization classes seem to need some special tags and attributes in the XML (boost_serialization tag, class_id / tracking_level / version attributes) to read from it, and the server process which creates this XML file doesn't put those attributes in there (and we would prefer to not have the maintainers of that process make a change just for us). Is there another way I can use Boost to read from an XML, and fill an object with its' values (like the serialization classes do), without needing those special tags / attrbutes?
Your best bet is to stick with some sort of general XML parser. Boost serialization syncronizes your file with the C++ data structure. You want the opposite. You want to fill yoru C++ data from some XML which serialization doesn't know about. Robert Ramey
Regards,
John
Falling You - exploring the beauty of voice and sound http://www.fallingyou.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Hi John, jmzorko@mac.com writes:
My question, though, is about this: There is another XML file that we have to read, that is generated by a server process that we do not directly control. We're currently using TinyXML to read from this XML file, but we would like to replace its' usage with something Boosty. The thing is, the current Boost serialization classes seem to need some special tags and attributes in the XML (boost_serialization tag, class_id / tracking_level / version attributes) to read from it, and the server process which creates this XML file doesn't put those attributes in there (and we would prefer to not have the maintainers of that process make a change just for us). Is there another way I can use Boost to read from an XML, and fill an object with its' values (like the serialization classes do), without needing those special tags / attrbutes?
You may be interested in XML data binding for C++, for example CodeSynthesis XSD[1]. It is an open-source (GPL + proprietary license), cross-platform XML data binding compiler for C++. [1] http://codesynthesis.com/products/xsd/ hth, -boris

jmzorko@mac.com wrote:
Hello, all ...
I've successfully used the Boost serialization classes to read our config file, as well as write updates to it. It seems to work well enough, and i'm appreciative of the effort that someone put into making these classes work.
My question, though, is about this: There is another XML file that we have to read, that is generated by a server process that we do not directly control. We're currently using TinyXML to read from this XML file, but we would like to replace its' usage with something Boosty. The thing is, the current Boost serialization classes seem to need some special tags and attributes in the XML (boost_serialization tag, class_id / tracking_level / version attributes) to read from it, and the server process which creates this XML file doesn't put those attributes in there (and we would prefer to not have the maintainers of that process make a change just for us). Is there another way I can use Boost to read from an XML, and fill an object with its' values (like the serialization classes do), without needing those special tags / attrbutes?
Regards,
John
Take a look at the Boost Property Tree library. It contains a very basic XML parser. It will be part of Boost 1.34 and is available in the Boost Vault. --Johan Råde

Johan Råde wrote:
Take a look at the Boost Property Tree library. It contains a very basic XML parser. It will be part of Boost 1.34 and is available in the Boost Vault.
Funny, I was just wondering about that yesterday. Boost.Property Tree isn't available in the RC_1_34_0 branch (at least not yet) and doesn't show up in the regression tests. // Johan (Nilsson)
participants (5)
-
Boris Kolpackov
-
jmzorko@mac.com
-
Johan Nilsson
-
Johan Råde
-
Robert Ramey