diff -r f387669912e8 -r e8619defde14 src/server/webdav/davparser.cpp --- a/src/server/webdav/davparser.cpp Sun May 06 10:09:27 2012 +0200 +++ b/src/server/webdav/davparser.cpp Wed May 16 12:47:28 2012 +0200 @@ -90,3 +90,50 @@ return davrq; } + +ProppatchRequest* dav_parse_proppatch( + Session *sn, + Request *rq, + char *xml, + size_t len) +{ + if(!xcinit) { + /* TODO: create webdav module init function */ + XMLPlatformUtils::Initialize(); + xcinit = 1; + } + ProppatchRequest *davrq = (ProppatchRequest*)pool_malloc( + sn->pool, + sizeof(PropfindRequest)); + + + + // create xml parser + SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(); + parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); + + ProppatchHandler handler(davrq, sn->pool); + parser->setContentHandler(&handler); + parser->setErrorHandler(&handler); + + MemBufInputSource source((XMLByte*)xml, (XMLSize_t)len, "wsid"); + try { + parser->parse(source); + } + catch (const XMLException& e) { + printf("XMLException\n"); + + } + catch (const SAXParseException& e) { + printf("SAXParseException\n"); + + } + catch (...) { + printf("davaparser Exception\n"); + } + + + + + return davrq; +}