39 #include <xsd/cxx/pre.hxx>
41 #include <otsdaq-utilities/ECLWriter/ECL.hxx>
46 const Tag_t::name_type& Tag_t::name()
const {
return this->name_.get(); }
48 Tag_t::name_type& Tag_t::name() {
return this->name_.get(); }
50 void Tag_t::name(
const name_type& x) { this->name_.set(x); }
52 void Tag_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); }
57 const Attachment_t::type_type& Attachment_t::type()
const {
return this->type_.get(); }
59 Attachment_t::type_type& Attachment_t::type() {
return this->type_.get(); }
61 void Attachment_t::type(
const type_type& x) { this->type_.set(x); }
63 void Attachment_t::type(::std::unique_ptr<type_type> x) { this->type_.set(std::move(x)); }
65 const Attachment_t::filename_type& Attachment_t::filename()
const
67 return this->filename_.get();
70 Attachment_t::filename_type& Attachment_t::filename() {
return this->filename_.get(); }
72 void Attachment_t::filename(
const filename_type& x) { this->filename_.set(x); }
74 void Attachment_t::filename(::std::unique_ptr<filename_type> x)
76 this->filename_.set(std::move(x));
82 const Field_t::name_type& Field_t::name()
const {
return this->name_.get(); }
84 Field_t::name_type& Field_t::name() {
return this->name_.get(); }
86 void Field_t::name(
const name_type& x) { this->name_.set(x); }
88 void Field_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); }
93 const Form_t::field_sequence& Form_t::field()
const {
return this->field_; }
95 Form_t::field_sequence& Form_t::field() {
return this->field_; }
97 void Form_t::field(
const field_sequence& s) { this->field_ = s; }
99 const Form_t::name_type& Form_t::name()
const {
return this->name_.get(); }
101 Form_t::name_type& Form_t::name() {
return this->name_.get(); }
103 void Form_t::name(
const name_type& x) { this->name_.set(x); }
105 void Form_t::name(::std::unique_ptr<name_type> x) { this->name_.set(std::move(x)); }
110 const ECLEntry_t::tag_sequence& ECLEntry_t::tag()
const {
return this->tag_; }
112 ECLEntry_t::tag_sequence& ECLEntry_t::tag() {
return this->tag_; }
114 void ECLEntry_t::tag(
const tag_sequence& s) { this->tag_ = s; }
116 const ECLEntry_t::attachment_sequence& ECLEntry_t::attachment()
const
118 return this->attachment_;
121 ECLEntry_t::attachment_sequence& ECLEntry_t::attachment() {
return this->attachment_; }
123 void ECLEntry_t::attachment(
const attachment_sequence& s) { this->attachment_ = s; }
125 const ECLEntry_t::form_optional& ECLEntry_t::form()
const {
return this->form_; }
127 ECLEntry_t::form_optional& ECLEntry_t::form() {
return this->form_; }
129 void ECLEntry_t::form(
const form_type& x) { this->form_.set(x); }
131 void ECLEntry_t::form(
const form_optional& x) { this->form_ = x; }
133 void ECLEntry_t::form(::std::unique_ptr<form_type> x) { this->form_.set(std::move(x)); }
135 const ECLEntry_t::author_type& ECLEntry_t::author()
const {
return this->author_.get(); }
137 ECLEntry_t::author_type& ECLEntry_t::author() {
return this->author_.get(); }
139 void ECLEntry_t::author(
const author_type& x) { this->author_.set(x); }
141 void ECLEntry_t::author(::std::unique_ptr<author_type> x)
143 this->author_.set(std::move(x));
146 const ECLEntry_t::category_type& ECLEntry_t::category()
const
148 return this->category_.get();
151 ECLEntry_t::category_type& ECLEntry_t::category() {
return this->category_.get(); }
153 void ECLEntry_t::category(
const category_type& x) { this->category_.set(x); }
155 void ECLEntry_t::category(::std::unique_ptr<category_type> x)
157 this->category_.set(std::move(x));
160 #include <xsd/cxx/xml/dom/parsing-source.hxx>
165 Tag_t::Tag_t() : ::xml_schema::type(), name_(this) {}
167 Tag_t::Tag_t(
const name_type& name) : ::xml_schema::type(), name_(name, this) {}
169 Tag_t::Tag_t(
const Tag_t& x, ::xml_schema::flags f, ::xml_schema::container* c)
170 : ::xml_schema::type(x, f, c), name_(x.name_, f, this)
174 Tag_t::Tag_t(const ::xercesc::DOMElement& e,
175 ::xml_schema::flags f,
176 ::xml_schema::container* c)
177 : ::xml_schema::type(e, f | ::xml_schema::flags::base, c), name_(this)
179 if((f & ::xml_schema::flags::base) == 0)
181 ::xsd::cxx::xml::dom::parser<char> p(e,
false,
false,
true);
186 void Tag_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
188 while(p.more_attributes())
190 const ::xercesc::DOMAttr& i(p.next_attribute());
191 const ::xsd::cxx::xml::qualified_name<char> n(
192 ::xsd::cxx::xml::dom::name<char>(i));
194 if(n.name() ==
"name" && n.namespace_().empty())
196 this->name_.set(name_traits::create(i, f,
this));
203 throw ::xsd::cxx::tree::expected_attribute<char>(
"name",
"");
207 Tag_t* Tag_t::_clone(::xml_schema::flags f, ::xml_schema::container* c)
const
209 return new class Tag_t(*
this, f, c);
216 static_cast< ::xml_schema::type&
>(*this) = x;
217 this->name_ = x.name_;
228 Attachment_t::Attachment_t() : ::xml_schema::base64_binary(), type_(this), filename_(this)
232 Attachment_t::Attachment_t(
const type_type& type,
const filename_type& filename)
233 : ::xml_schema::base64_binary(), type_(type, this), filename_(filename, this)
237 Attachment_t::Attachment_t(const ::xml_schema::base64_binary& _xsd_base64_binary_base,
238 const type_type& type,
239 const filename_type& filename)
240 : ::xml_schema::base64_binary(_xsd_base64_binary_base)
242 , filename_(filename, this)
247 ::xml_schema::flags f,
248 ::xml_schema::container* c)
249 : ::xml_schema::base64_binary(x, f, c)
250 , type_(x.type_, f, this)
251 , filename_(x.filename_, f, this)
255 Attachment_t::Attachment_t(const ::xercesc::DOMElement& e,
256 ::xml_schema::flags f,
257 ::xml_schema::container* c)
258 : ::xml_schema::base64_binary(e, f | ::xml_schema::flags::base, c)
262 if((f & ::xml_schema::flags::base) == 0)
264 ::xsd::cxx::xml::dom::parser<char> p(e,
false,
false,
true);
269 void Attachment_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
271 while(p.more_attributes())
273 const ::xercesc::DOMAttr& i(p.next_attribute());
274 const ::xsd::cxx::xml::qualified_name<char> n(
275 ::xsd::cxx::xml::dom::name<char>(i));
277 if(n.name() ==
"type" && n.namespace_().empty())
279 this->type_.set(type_traits::create(i, f,
this));
283 if(n.name() ==
"filename" && n.namespace_().empty())
285 this->filename_.set(filename_traits::create(i, f,
this));
292 throw ::xsd::cxx::tree::expected_attribute<char>(
"type",
"");
295 if(!filename_.present())
297 throw ::xsd::cxx::tree::expected_attribute<char>(
"filename",
"");
301 Attachment_t* Attachment_t::_clone(::xml_schema::flags f,
302 ::xml_schema::container* c)
const
311 static_cast< ::xml_schema::base64_binary&
>(*this) = x;
312 this->type_ = x.type_;
313 this->filename_ = x.filename_;
319 Attachment_t::~Attachment_t() {}
324 Field_t::Field_t() : ::xml_schema::string(), name_(this) {}
326 Field_t::Field_t(
const name_type& name) : ::xml_schema::string(), name_(name, this) {}
328 Field_t::Field_t(
const char* _xsd_string_base,
const name_type& name)
329 : ::xml_schema::string(_xsd_string_base), name_(name, this)
333 Field_t::Field_t(const ::std::string& _xsd_string_base,
const name_type& name)
334 : ::xml_schema::string(_xsd_string_base), name_(name, this)
338 Field_t::Field_t(const ::xml_schema::string& _xsd_string_base,
const name_type& name)
339 : ::xml_schema::string(_xsd_string_base), name_(name, this)
343 Field_t::Field_t(
const Field_t& x, ::xml_schema::flags f, ::xml_schema::container* c)
344 : ::xml_schema::string(x, f, c), name_(x.name_, f, this)
348 Field_t::Field_t(const ::xercesc::DOMElement& e,
349 ::xml_schema::flags f,
350 ::xml_schema::container* c)
351 : ::xml_schema::string(e, f | ::xml_schema::flags::base, c), name_(this)
353 if((f & ::xml_schema::flags::base) == 0)
355 ::xsd::cxx::xml::dom::parser<char> p(e,
false,
false,
true);
360 void Field_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
362 while(p.more_attributes())
364 const ::xercesc::DOMAttr& i(p.next_attribute());
365 const ::xsd::cxx::xml::qualified_name<char> n(
366 ::xsd::cxx::xml::dom::name<char>(i));
368 if(n.name() ==
"name" && n.namespace_().empty())
370 this->name_.set(name_traits::create(i, f,
this));
377 throw ::xsd::cxx::tree::expected_attribute<char>(
"name",
"");
381 Field_t* Field_t::_clone(::xml_schema::flags f, ::xml_schema::container* c)
const
383 return new class Field_t(*
this, f, c);
390 static_cast< ::xml_schema::string&
>(*this) = x;
391 this->name_ = x.name_;
397 Field_t::~Field_t() {}
402 Form_t::Form_t() : ::xml_schema::type(), field_(this), name_(this) {}
404 Form_t::Form_t(
const name_type& name)
405 : ::xml_schema::type(), field_(this), name_(name, this)
409 Form_t::Form_t(
const Form_t& x, ::xml_schema::flags f, ::xml_schema::container* c)
410 : ::xml_schema::type(x, f, c), field_(x.field_, f, this), name_(x.name_, f, this)
414 Form_t::Form_t(const ::xercesc::DOMElement& e,
415 ::xml_schema::flags f,
416 ::xml_schema::container* c)
417 : ::xml_schema::type(e, f | ::xml_schema::flags::base, c), field_(this), name_(this)
419 if((f & ::xml_schema::flags::base) == 0)
421 ::xsd::cxx::xml::dom::parser<char> p(e,
true,
false,
true);
426 void Form_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
428 for(; p.more_content(); p.next_content(
false))
430 const ::xercesc::DOMElement& i(p.cur_element());
431 const ::xsd::cxx::xml::qualified_name<char> n(
432 ::xsd::cxx::xml::dom::name<char>(i));
436 if(n.name() ==
"field" && n.namespace_().empty())
438 ::std::unique_ptr<field_type> r(field_traits::create(i, f,
this));
440 this->field_.push_back(::std::move(r));
447 while(p.more_attributes())
449 const ::xercesc::DOMAttr& i(p.next_attribute());
450 const ::xsd::cxx::xml::qualified_name<char> n(
451 ::xsd::cxx::xml::dom::name<char>(i));
453 if(n.name() ==
"name" && n.namespace_().empty())
455 this->name_.set(name_traits::create(i, f,
this));
462 throw ::xsd::cxx::tree::expected_attribute<char>(
"name",
"");
466 Form_t* Form_t::_clone(::xml_schema::flags f, ::xml_schema::container* c)
const
468 return new class Form_t(*
this, f, c);
475 static_cast< ::xml_schema::type&
>(*this) = x;
476 this->field_ = x.field_;
477 this->name_ = x.name_;
488 ECLEntry_t::ECLEntry_t()
489 : ::xml_schema::type()
498 ECLEntry_t::ECLEntry_t(
const author_type& author,
const category_type& category)
499 : ::xml_schema::type()
503 , author_(author, this)
504 , category_(category, this)
509 ::xml_schema::flags f,
510 ::xml_schema::container* c)
511 : ::xml_schema::type(x, f, c)
512 , tag_(x.tag_, f, this)
513 , attachment_(x.attachment_, f, this)
514 , form_(x.form_, f, this)
515 , author_(x.author_, f, this)
516 , category_(x.category_, f, this)
520 ECLEntry_t::ECLEntry_t(const ::xercesc::DOMElement& e,
521 ::xml_schema::flags f,
522 ::xml_schema::container* c)
523 : ::xml_schema::type(e, f | ::xml_schema::flags::base, c)
530 if((f & ::xml_schema::flags::base) == 0)
532 ::xsd::cxx::xml::dom::parser<char> p(e,
true,
false,
true);
537 void ECLEntry_t::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::flags f)
539 for(; p.more_content(); p.next_content(
false))
541 const ::xercesc::DOMElement& i(p.cur_element());
542 const ::xsd::cxx::xml::qualified_name<char> n(
543 ::xsd::cxx::xml::dom::name<char>(i));
547 if(n.name() ==
"tag" && n.namespace_().empty())
549 ::std::unique_ptr<tag_type> r(tag_traits::create(i, f,
this));
551 this->tag_.push_back(::std::move(r));
557 if(n.name() ==
"attachment" && n.namespace_().empty())
559 ::std::unique_ptr<attachment_type> r(attachment_traits::create(i, f,
this));
561 this->attachment_.push_back(::std::move(r));
567 if(n.name() ==
"form" && n.namespace_().empty())
569 ::std::unique_ptr<form_type> r(form_traits::create(i, f,
this));
573 this->form_.set(::std::move(r));
581 while(p.more_attributes())
583 const ::xercesc::DOMAttr& i(p.next_attribute());
584 const ::xsd::cxx::xml::qualified_name<char> n(
585 ::xsd::cxx::xml::dom::name<char>(i));
587 if(n.name() ==
"author" && n.namespace_().empty())
589 this->author_.set(author_traits::create(i, f,
this));
593 if(n.name() ==
"category" && n.namespace_().empty())
595 this->category_.set(category_traits::create(i, f,
this));
600 if(!author_.present())
602 throw ::xsd::cxx::tree::expected_attribute<char>(
"author",
"");
605 if(!category_.present())
607 throw ::xsd::cxx::tree::expected_attribute<char>(
"category",
"");
611 ECLEntry_t* ECLEntry_t::_clone(::xml_schema::flags f, ::xml_schema::container* c)
const
620 static_cast< ::xml_schema::type&
>(*this) = x;
622 this->attachment_ = x.attachment_;
623 this->form_ = x.form_;
624 this->author_ = x.author_;
625 this->category_ = x.category_;
631 ECLEntry_t::~ECLEntry_t() {}
635 ::std::ostream& operator<<(::std::ostream& o,
const Tag_t& i)
637 o << ::std::endl <<
"name: " << i.name();
641 ::std::ostream& operator<<(::std::ostream& o,
const Attachment_t& i)
643 o << static_cast<const ::xml_schema::base64_binary&>(i);
645 o << ::std::endl <<
"type: " << i.type();
646 o << ::std::endl <<
"filename: " << i.filename();
650 ::std::ostream& operator<<(::std::ostream& o,
const Field_t& i)
652 o << static_cast<const ::xml_schema::string&>(i);
654 o << ::std::endl <<
"name: " << i.name();
658 ::std::ostream& operator<<(::std::ostream& o,
const Form_t& i)
660 for(Form_t::field_const_iterator b(i.field().begin()), e(i.field().end()); b != e;
663 o << ::std::endl <<
"field: " << *b;
666 o << ::std::endl <<
"name: " << i.name();
670 ::std::ostream& operator<<(::std::ostream& o,
const ECLEntry_t& i)
672 for(ECLEntry_t::tag_const_iterator b(i.tag().begin()), e(i.tag().end()); b != e; ++b)
674 o << ::std::endl <<
"tag: " << *b;
677 for(ECLEntry_t::attachment_const_iterator b(i.attachment().begin()),
678 e(i.attachment().end());
682 o << ::std::endl <<
"attachment: " << *b;
687 o << ::std::endl <<
"form: " << *i.form();
690 o << ::std::endl <<
"author: " << i.author();
691 o << ::std::endl <<
"category: " << i.category();
696 #include <xsd/cxx/tree/error-handler.hxx>
697 #include <xsd/cxx/xml/sax/std-input-source.hxx>
699 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u,
700 ::xml_schema::flags f,
701 const ::xml_schema::properties& p)
703 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
704 (f & ::xml_schema::flags::keep_dom) == 0);
706 ::xsd::cxx::tree::error_handler<char> h;
708 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
709 ::xsd::cxx::xml::dom::parse<char>(u, h, p, f));
711 h.throw_if_failed< ::xsd::cxx::tree::parsing<char> >();
713 return ::std::unique_ptr< ::ECLEntry_t>(
714 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
717 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u,
718 ::xml_schema::error_handler& h,
719 ::xml_schema::flags f,
720 const ::xml_schema::properties& p)
722 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
723 (f & ::xml_schema::flags::keep_dom) == 0);
725 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
726 ::xsd::cxx::xml::dom::parse<char>(u, h, p, f));
729 throw ::xsd::cxx::tree::parsing<char>();
731 return ::std::unique_ptr< ::ECLEntry_t>(
732 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
735 ::std::unique_ptr< ::ECLEntry_t> entry(const ::std::string& u,
736 ::xercesc::DOMErrorHandler& h,
737 ::xml_schema::flags f,
738 const ::xml_schema::properties& p)
740 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
741 ::xsd::cxx::xml::dom::parse<char>(u, h, p, f));
744 throw ::xsd::cxx::tree::parsing<char>();
746 return ::std::unique_ptr< ::ECLEntry_t>(
747 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
750 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
751 ::xml_schema::flags f,
752 const ::xml_schema::properties& p)
754 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
755 (f & ::xml_schema::flags::keep_dom) == 0);
757 ::xsd::cxx::xml::sax::std_input_source isrc(is);
758 return ::entry(isrc, f, p);
761 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
762 ::xml_schema::error_handler& h,
763 ::xml_schema::flags f,
764 const ::xml_schema::properties& p)
766 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
767 (f & ::xml_schema::flags::keep_dom) == 0);
769 ::xsd::cxx::xml::sax::std_input_source isrc(is);
770 return ::entry(isrc, h, f, p);
773 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
774 ::xercesc::DOMErrorHandler& h,
775 ::xml_schema::flags f,
776 const ::xml_schema::properties& p)
778 ::xsd::cxx::xml::sax::std_input_source isrc(is);
779 return ::entry(isrc, h, f, p);
782 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
783 const ::std::string& sid,
784 ::xml_schema::flags f,
785 const ::xml_schema::properties& p)
787 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
788 (f & ::xml_schema::flags::keep_dom) == 0);
790 ::xsd::cxx::xml::sax::std_input_source isrc(is, sid);
791 return ::entry(isrc, f, p);
794 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
795 const ::std::string& sid,
796 ::xml_schema::error_handler& h,
797 ::xml_schema::flags f,
798 const ::xml_schema::properties& p)
800 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0,
801 (f & ::xml_schema::flags::keep_dom) == 0);
803 ::xsd::cxx::xml::sax::std_input_source isrc(is, sid);
804 return ::entry(isrc, h, f, p);
807 ::std::unique_ptr< ::ECLEntry_t> entry(::std::istream& is,
808 const ::std::string& sid,
809 ::xercesc::DOMErrorHandler& h,
810 ::xml_schema::flags f,
811 const ::xml_schema::properties& p)
813 ::xsd::cxx::xml::sax::std_input_source isrc(is, sid);
814 return ::entry(isrc, h, f, p);
817 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i,
818 ::xml_schema::flags f,
819 const ::xml_schema::properties& p)
821 ::xsd::cxx::tree::error_handler<char> h;
823 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
824 ::xsd::cxx::xml::dom::parse<char>(i, h, p, f));
826 h.throw_if_failed< ::xsd::cxx::tree::parsing<char> >();
828 return ::std::unique_ptr< ::ECLEntry_t>(
829 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
832 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i,
833 ::xml_schema::error_handler& h,
834 ::xml_schema::flags f,
835 const ::xml_schema::properties& p)
837 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
838 ::xsd::cxx::xml::dom::parse<char>(i, h, p, f));
841 throw ::xsd::cxx::tree::parsing<char>();
843 return ::std::unique_ptr< ::ECLEntry_t>(
844 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
847 ::std::unique_ptr< ::ECLEntry_t> entry(::xercesc::InputSource& i,
848 ::xercesc::DOMErrorHandler& h,
849 ::xml_schema::flags f,
850 const ::xml_schema::properties& p)
852 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
853 ::xsd::cxx::xml::dom::parse<char>(i, h, p, f));
856 throw ::xsd::cxx::tree::parsing<char>();
858 return ::std::unique_ptr< ::ECLEntry_t>(
859 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
862 ::std::unique_ptr< ::ECLEntry_t> entry(const ::xercesc::DOMDocument& doc,
863 ::xml_schema::flags f,
864 const ::xml_schema::properties& p)
866 if(f & ::xml_schema::flags::keep_dom)
868 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
869 static_cast< ::xercesc::DOMDocument*>(doc.cloneNode(
true)));
871 return ::std::unique_ptr< ::ECLEntry_t>(
872 ::entry(std::move(d), f | ::xml_schema::flags::own_dom, p));
875 const ::xercesc::DOMElement& e(*doc.getDocumentElement());
876 const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e));
878 if(n.name() ==
"entry" && n.namespace_() ==
"")
880 ::std::unique_ptr< ::ECLEntry_t> r(
881 ::xsd::cxx::tree::traits< ::ECLEntry_t, char>::create(e, f, 0));
885 throw ::xsd::cxx::tree::unexpected_element<char>(
886 n.name(), n.namespace_(),
"entry",
"");
889 ::std::unique_ptr< ::ECLEntry_t> entry(
890 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d,
891 ::xml_schema::flags f,
892 const ::xml_schema::properties&)
894 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> c(
895 ((f & ::xml_schema::flags::keep_dom) && !(f & ::xml_schema::flags::own_dom))
896 ? static_cast< ::xercesc::DOMDocument*>(d->cloneNode(
true))
899 ::xercesc::DOMDocument& doc(c.get() ? *c : *d);
900 const ::xercesc::DOMElement& e(*doc.getDocumentElement());
902 const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e));
904 if(f & ::xml_schema::flags::keep_dom)
905 doc.setUserData(::xml_schema::dom::tree_node_key, (c.get() ? &c : &d), 0);
907 if(n.name() ==
"entry" && n.namespace_() ==
"")
909 ::std::unique_ptr< ::ECLEntry_t> r(
910 ::xsd::cxx::tree::traits< ::ECLEntry_t, char>::create(e, f, 0));
914 throw ::xsd::cxx::tree::unexpected_element<char>(
915 n.name(), n.namespace_(),
"entry",
"");
919 #include <xsd/cxx/tree/error-handler.hxx>
920 #include <xsd/cxx/xml/dom/serialization-source.hxx>
922 void entry(::std::ostream& o,
923 const ::ECLEntry_t& s,
924 const ::xml_schema::namespace_infomap& m,
925 const ::std::string& e,
926 ::xml_schema::flags f)
928 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0);
930 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
932 ::xsd::cxx::tree::error_handler<char> h;
934 ::xsd::cxx::xml::dom::ostream_format_target t(o);
935 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
937 h.throw_if_failed< ::xsd::cxx::tree::serialization<char> >();
941 void entry(::std::ostream& o,
942 const ::ECLEntry_t& s,
943 ::xml_schema::error_handler& h,
944 const ::xml_schema::namespace_infomap& m,
945 const ::std::string& e,
946 ::xml_schema::flags f)
948 ::xsd::cxx::xml::auto_initializer i((f & ::xml_schema::flags::dont_initialize) == 0);
950 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
951 ::xsd::cxx::xml::dom::ostream_format_target t(o);
952 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
954 throw ::xsd::cxx::tree::serialization<char>();
958 void entry(::std::ostream& o,
959 const ::ECLEntry_t& s,
960 ::xercesc::DOMErrorHandler& h,
961 const ::xml_schema::namespace_infomap& m,
962 const ::std::string& e,
963 ::xml_schema::flags f)
965 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
966 ::xsd::cxx::xml::dom::ostream_format_target t(o);
967 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
969 throw ::xsd::cxx::tree::serialization<char>();
973 void entry(::xercesc::XMLFormatTarget& t,
974 const ::ECLEntry_t& s,
975 const ::xml_schema::namespace_infomap& m,
976 const ::std::string& e,
977 ::xml_schema::flags f)
979 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
981 ::xsd::cxx::tree::error_handler<char> h;
983 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
985 h.throw_if_failed< ::xsd::cxx::tree::serialization<char> >();
989 void entry(::xercesc::XMLFormatTarget& t,
990 const ::ECLEntry_t& s,
991 ::xml_schema::error_handler& h,
992 const ::xml_schema::namespace_infomap& m,
993 const ::std::string& e,
994 ::xml_schema::flags f)
996 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
997 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
999 throw ::xsd::cxx::tree::serialization<char>();
1003 void entry(::xercesc::XMLFormatTarget& t,
1004 const ::ECLEntry_t& s,
1005 ::xercesc::DOMErrorHandler& h,
1006 const ::xml_schema::namespace_infomap& m,
1007 const ::std::string& e,
1008 ::xml_schema::flags f)
1010 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(::entry(s, m, f));
1011 if(!::xsd::cxx::xml::dom::serialize(t, *d, e, h, f))
1013 throw ::xsd::cxx::tree::serialization<char>();
1017 void entry(::xercesc::DOMDocument& d, const ::ECLEntry_t& s, ::xml_schema::flags)
1019 ::xercesc::DOMElement& e(*d.getDocumentElement());
1020 const ::xsd::cxx::xml::qualified_name<char> n(::xsd::cxx::xml::dom::name<char>(e));
1022 if(n.name() ==
"entry" && n.namespace_() ==
"")
1028 throw ::xsd::cxx::tree::unexpected_element<char>(
1029 n.name(), n.namespace_(),
"entry",
"");
1033 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> entry(
1034 const ::ECLEntry_t& s,
1035 const ::xml_schema::namespace_infomap& m,
1036 ::xml_schema::flags f)
1038 ::xml_schema::dom::unique_ptr< ::xercesc::DOMDocument> d(
1039 ::xsd::cxx::xml::dom::serialize<char>(
"entry",
"", m, f));
1045 void operator<<(::xercesc::DOMElement& e,
const Tag_t& i)
1047 e << static_cast<const ::xml_schema::type&>(i);
1052 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute(
"name", e));
1058 void operator<<(::xercesc::DOMElement& e,
const Attachment_t& i)
1060 e << static_cast<const ::xml_schema::base64_binary&>(i);
1065 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute(
"type", e));
1073 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute(
"filename", e));
1079 void operator<<(::xercesc::DOMElement& e,
const Field_t& i)
1081 e << static_cast<const ::xml_schema::string&>(i);
1086 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute(
"name", e));
1092 void operator<<(::xercesc::DOMElement& e,
const Form_t& i)
1094 e << static_cast<const ::xml_schema::type&>(i);
1098 for(Form_t::field_const_iterator b(i.field().begin()), n(i.field().end()); b != n;
1101 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element(
"field", e));
1109 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute(
"name", e));
1115 void operator<<(::xercesc::DOMElement& e,
const ECLEntry_t& i)
1117 e << static_cast<const ::xml_schema::type&>(i);
1121 for(ECLEntry_t::tag_const_iterator b(i.tag().begin()), n(i.tag().end()); b != n; ++b)
1123 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element(
"tag", e));
1130 for(ECLEntry_t::attachment_const_iterator b(i.attachment().begin()),
1131 n(i.attachment().end());
1135 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element(
"attachment", e));
1144 ::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element(
"form", e));
1152 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute(
"author", e));
1160 ::xercesc::DOMAttr& a(::xsd::cxx::xml::dom::create_attribute(
"category", e));
1166 #include <xsd/cxx/post.hxx>