1 // file : examples/cxx/tree/custom/double/double-custom.hxx 2 // copyright : not copyrighted - public domain 3 4 // Do not include this file directly, use xml-schema.hxx instead. This 5 // file is included into generated xml-schema.hxx so we do not need to 6 // guard against multiple inclusions. 7 // 8 9 #include <xsd/cxx/xml/string.hxx> // xml::transcode 10 #include <xsd/cxx/tree/text.hxx> // text_content 11 12 // Parsing. 13 // 14 namespace xsd 15 { 16 namespace cxx 17 { 18 namespace tree 19 { 20 template<> 21 struct traits<double, char, schema_type::double_> 22 { 23 static double createxsd::cxx::tree::traits24 create (const xercesc::DOMElement& e, flags f, type* c) 25 { 26 return create (text_content<char> (e), 0, f, c); 27 } 28 29 static double createxsd::cxx::tree::traits30 create (const xercesc::DOMAttr& a, flags f, type* c) 31 { 32 return create (xml::transcode<char> (a.getValue ()), 0, f, c); 33 } 34 35 static double 36 create (const std::string& s, 37 const xercesc::DOMElement*, 38 flags, 39 type*); 40 }; 41 } 42 } 43 } 44 45 // Serialization. 46 // 47 namespace XERCES_CPP_NAMESPACE 48 { 49 void 50 operator<< (xercesc::DOMElement& e, const xml_schema::as_double& d); 51 52 void 53 operator<< (xercesc::DOMAttr& a, const xml_schema::as_double& d); 54 } 55 56 namespace xsd 57 { 58 namespace cxx 59 { 60 namespace tree 61 { 62 void 63 operator<< (xml_schema::list_stream& ls, 64 const xml_schema::as_double& d); 65 } 66 } 67 } 68