2 #include "TypeConversions.hxx"
3 #include "XMLCppConv.hxx"
6 #include <libxml/parser.h>
12 #include "YacsTrace.hxx"
20 Any * convertXmlCpp(const TypeCode *t, xmlDocPtr doc, xmlNodePtr cur)
22 return convertXmlNeutral(t, doc, cur);
25 XmlCpp::XmlCpp(InputPort* p)
26 : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
30 void XmlCpp::put(const void *data) throw(ConversionException)
32 DEBTRACE(" XmlCpp::put(const void *data)");
33 put((const char *)data);
36 //!Convert received XML (char *) value to C++ (Any *) value and send it to proxy port
38 * \param data : Xml::char *
41 void XmlCpp::put(const char *data) throw(ConversionException)
43 DEBTRACE("XmlCpp::put " << data);
48 doc = xmlParseMemory(data, strlen(data));
52 msg << "Problem in conversion: XML Document not parsed successfully ";
53 msg << " (" << __FILE__ << ":" << __LINE__ << ")";
54 throw ConversionException(msg.str());
56 cur = xmlDocGetRootElement(doc);
61 msg << "Problem in conversion: empty XML Document";
62 msg << " (" << __FILE__ << ":" << __LINE__ << ")";
63 throw ConversionException(msg.str());
67 if ((!xmlStrcmp(cur->name, (const xmlChar *)"value")))
69 ob=convertXmlCpp(edGetType(),doc,cur);
81 int isAdaptableCppXml(const TypeCode *t1, const TypeCode *t2)
83 return isAdaptableNeutralXml(t1, t2);