src/XMLCommand.h
branchv_0
changeset 4 1363ec0879ca
parent 3 4b566dee1a57
child 5 e5cf88ce91ac
equal deleted inserted replaced
3:4b566dee1a57 4:1363ec0879ca
    49 	public:
    49 	public:
    50 
    50 
    51 		RelpipeSaxHandler(std::ostream& output) : DefaultHandler(), writer(Factory::create(output)) {
    51 		RelpipeSaxHandler(std::ostream& output) : DefaultHandler(), writer(Factory::create(output)) {
    52 		}
    52 		}
    53 
    53 
    54 		void startElement(const XMLCh * const uri, const XMLCh * const localname, const XMLCh * const qname, const Attributes& attrs) override {
    54 		void startDocument() override {
    55 			//XMLString::
    55 			//XMLString::
    56 			// TODO: remove demo
    56 			// TODO: remove demo
    57 			writer->startRelation(L"xml_startElement",{
    57 			writer->startRelation(L"xml",{
    58 				{L"s", TypeId::STRING},
    58 				{L"event", TypeId::STRING},
       
    59 				{L"data", TypeId::STRING},
    59 			}, true);
    60 			}, true);
       
    61 		}
    60 
    62 
    61 			writer->writeAttribute(L"a");
    63 		void startElement(const XMLCh * const uri, const XMLCh * const localname, const XMLCh * const qname, const Attributes& attrs) override {
       
    64 			writer->writeAttribute(L"startElement");
       
    65 			writer->writeAttribute(L"");
    62 		}
    66 		}
    63 
    67 
    64 		void endElement(const XMLCh * const uri, const XMLCh * const localname, const XMLCh * const qname) override {
    68 		void endElement(const XMLCh * const uri, const XMLCh * const localname, const XMLCh * const qname) override {
    65 			// TODO: remove demo
    69 			writer->writeAttribute(L"endElement");
    66 			writer->startRelation(L"xml_endElement",{
    70 			writer->writeAttribute(L"");
    67 				{L"s", TypeId::STRING},
    71 		}
    68 			}, true);
       
    69 
    72 
    70 			writer->writeAttribute(L"a");
    73 		void characters(const XMLCh * const chars, const XMLSize_t length) override {
       
    74 			writer->writeAttribute(L"characters");
       
    75 			writer->writeAttribute(to_wstring(length));
    71 		}
    76 		}
    72 
    77 
    73 		void endDocument() override {
    78 		void endDocument() override {
    74 			// TODO: remove demo
    79 			writer->writeAttribute(L"endDocument");
    75 			writer->startRelation(L"xml_endDocument",{
    80 			writer->writeAttribute(L"");
    76 				{L"s", TypeId::STRING},
       
    77 			}, true);
       
    78 
       
    79 			writer->writeAttribute(L"a");
       
    80 		}
    81 		}
    81 
    82 
    82 	};
    83 	};
    83 
    84 
    84 public:
    85 public: