2 #include "TypeConversions.hxx"
3 #include "XMLCORBAConv.hxx"
4 #include "CORBAXMLConv.hxx"
6 #include <libxml/parser.h>
11 #include "YacsTrace.hxx"
13 using namespace YACS::ENGINE;
16 XmlCorba::XmlCorba(InputCorbaPort* p)
17 : ProxyPort(p), DataPort(p->getName(), p->getNode(), p->edGetType()), Port(p->getNode())
21 void XmlCorba::put(const void *data) throw(ConversionException)
23 DEBTRACE((const char *)data);
24 put((const char *)data);
27 //!Convert a XML (char *) to CORBA::Any and push it in the proxy port
29 * \param data : Xml::char *
31 void XmlCorba::put(const char *data) throw(ConversionException)
38 doc = xmlParseMemory(data, strlen(data));
42 msg << "Problem in conversion: XML Document not parsed successfully ";
43 msg << " (" << __FILE__ << ":" << __LINE__ << ")";
44 throw ConversionException(msg.str());
46 cur = xmlDocGetRootElement(doc);
51 msg << "Problem in conversion: empty XML Document";
52 msg << " (" << __FILE__ << ":" << __LINE__ << ")";
53 throw ConversionException(msg.str());
57 if ((!xmlStrcmp(cur->name, (const xmlChar *)"value")))
61 a=convertXmlCorba(edGetType(),doc,cur);
63 catch(ConversionException)
70 msg << "Problem in conversion: kind= " << edGetType()->kind() ;
71 msg << " (" << __FILE__ << ":" << __LINE__ << ")";
72 throw ConversionException(msg.str());
81 _port->setStringRef(data);
82 //delete Any that has been allocated by convertXmlCorba