Hi,
I can't reproduce the problem. Here is my more complete program:
#include <iostream>
#include <cxxtools/xml/xmldeserializer.h>
#include <cxxtools/serializationinfo.h>
#include <cxxtools/log.h>
struct FixMl
{
std::string foo;
};
void operator>>= (const cxxtools::SerializationInfo& si, FixMl& fixMl)
{
si.getMember("TrdCaptRpt").getMember("Foo") >>= fixMl.foo;
}
int main(int argc, char* argv[])
{
try
{
log_init();
bool extractAttributes = true;
cxxtools::xml::XmlDeserializer deserializer(std::cin,
extractAttributes);
FixMl fixMl;
deserializer.deserialize(fixMl);
std::cout << fixMl.foo << std::endl;
}
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
}
}
Compiling to foo and running
./foo <foo1.xml
prints "Bar" with both xml files. Can you show your test case?
Tommi
On 01.07.2015 10:48, Andreas Welchlin wrote:
Hi All,
I think I found a bug in the deserializer. When I want to get the
Attribute "Foo" in the XML below, it is not visible for the serializer.
<FIXML>
<TrdCaptRpt Foo="Bar" >
<RptSide>
</RptSide>
</TrdCaptRpt>
</FIXML>
When the XML looks like this, then Foo is visible and everything is fine.
<FIXML>
<TrdCaptRpt Foo="Bar" >
</TrdCaptRpt>
</FIXML>
The code:
std::istringstream xmlstream(xmlString);
bool extractAttributes = true;
cxxtools::xml::XmlDeserializer deserializer(xmlstream, extractAttributes);
deserializer.deserialize(*this);
Andreas
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general