39 #include <xsd/cxx/pre.hxx>
51 return this->element_data_;
57 return this->element_data_;
63 this->element_data_ = s;
69 return this->spaceType_;
75 return this->spaceType_;
81 this->spaceType_.set (x);
93 this->spaceType_.set (x);
103 return this->e_id_.get ();
109 return this->e_id_.get ();
121 return this->ord_.get ();
127 return this->ord_.get ();
139 return this->bd_.get ();
145 return this->bd_.get ();
157 return this->n_.get ();
163 return this->n_.get ();
175 return this->chgd_.get ();
181 return this->chgd_.get ();
191 #include <xsd/cxx/xml/dom/parsing-source.hxx>
200 : ::xml_schema::
type (),
201 element_data_ (::xml_schema::
flags (), this),
202 spaceType_ (::xml_schema::
flags (), this)
210 : ::xml_schema::
type (x, f, c),
211 element_data_ (x.element_data_, f, this),
212 spaceType_ (x.spaceType_, f, this)
217 space (const ::xercesc::DOMElement& e,
220 : ::xml_schema::
type (e, f | ::xml_schema::
flags::base, c),
221 element_data_ (f, this),
224 if ((f & ::xml_schema::flags::base) == 0)
226 ::xsd::cxx::xml::dom::parser< char > p (e,
true,
true);
232 parse (::xsd::cxx::xml::dom::parser< char >& p,
235 for (; p.more_elements (); p.next_element ())
237 const ::xercesc::DOMElement& i (p.cur_element ());
238 const ::xsd::cxx::xml::qualified_name< char > n (
239 ::xsd::cxx::xml::dom::name< char > (i));
243 if (n.name () ==
"element_data" && n.namespace_ ().empty ())
245 ::std::auto_ptr< element_data_type > r (
246 element_data_traits::create (i, f,
this));
248 this->element_data_.push_back (r);
255 while (p.more_attributes ())
257 const ::xercesc::DOMAttr& i (p.next_attribute ());
258 const ::xsd::cxx::xml::qualified_name< char > n (
259 ::xsd::cxx::xml::dom::name< char > (i));
261 if (n.name () ==
"spaceType" && n.namespace_ ().empty ())
263 ::std::auto_ptr< spaceType_type > r (
264 spaceType_traits::create (i, f,
this));
266 this->spaceType_.set (r);
276 return new class space (*
this, f, c);
293 : ::xml_schema::
type (),
294 e_id_ (e_id, ::xml_schema::
flags (), this),
295 ord_ (ord, ::xml_schema::
flags (), this),
296 bd_ (bd, ::xml_schema::
flags (), this),
297 n_ (n, ::xml_schema::
flags (), this),
298 chgd_ (chgd, ::xml_schema::
flags (), this)
306 : ::xml_schema::
type (x, f, c),
307 e_id_ (x.e_id_, f, this),
308 ord_ (x.ord_, f, this),
309 bd_ (x.bd_, f, this),
311 chgd_ (x.chgd_, f, this)
319 : ::xml_schema::
type (e, f | ::xml_schema::
flags::base, c),
326 if ((f & ::xml_schema::flags::base) == 0)
328 ::xsd::cxx::xml::dom::parser< char > p (e,
false,
true);
334 parse (::xsd::cxx::xml::dom::parser< char >& p,
337 while (p.more_attributes ())
339 const ::xercesc::DOMAttr& i (p.next_attribute ());
340 const ::xsd::cxx::xml::qualified_name< char >
n (
341 ::xsd::cxx::xml::dom::name< char > (i));
343 if (
n.name () ==
"e_id" &&
n.namespace_ ().empty ())
345 this->e_id_.set (e_id_traits::create (i, f,
this));
349 if (
n.name () ==
"ord" &&
n.namespace_ ().empty ())
351 this->ord_.set (ord_traits::create (i, f,
this));
355 if (
n.name () ==
"bd" &&
n.namespace_ ().empty ())
357 this->bd_.set (bd_traits::create (i, f,
this));
361 if (
n.name () ==
"n" &&
n.namespace_ ().empty ())
363 this->n_.set (n_traits::create (i, f,
this));
367 if (
n.name () ==
"chgd" &&
n.namespace_ ().empty ())
369 this->chgd_.set (chgd_traits::create (i, f,
this));
374 if (!e_id_.present ())
376 throw ::xsd::cxx::tree::expected_attribute< char > (
381 if (!ord_.present ())
383 throw ::xsd::cxx::tree::expected_attribute< char > (
390 throw ::xsd::cxx::tree::expected_attribute< char > (
397 throw ::xsd::cxx::tree::expected_attribute< char > (
402 if (!chgd_.present ())
404 throw ::xsd::cxx::tree::expected_attribute< char > (
428 operator<< (::std::ostream& o,
const space& i)
431 b (i.element_data ().begin ()), e (i.element_data ().end ());
434 o << ::std::endl <<
"element_data: " << *b;
439 o << ::std::endl <<
"spaceType: " << *i.spaceType ();
446 operator<< (::std::ostream& o,
const element_data& i)
448 o << ::std::endl <<
"e_id: " << i.e_id ();
449 o << ::std::endl <<
"ord: " << i.ord ();
450 o << ::std::endl <<
"bd: " << i.bd ();
451 o << ::std::endl <<
"n: " << i.n ();
452 o << ::std::endl <<
"chgd: " << i.chgd ();
458 #include <xsd/cxx/xml/sax/std-input-source.hxx>
459 #include <xsd/cxx/tree/error-handler.hxx>
463 ::std::auto_ptr< ::XMLSpace::space >
468 ::xsd::cxx::xml::auto_initializer i (
469 (f & ::xml_schema::flags::dont_initialize) == 0,
470 (f & ::xml_schema::flags::keep_dom) == 0);
472 ::xsd::cxx::tree::error_handler< char > h;
474 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
475 ::xsd::cxx::xml::dom::parse< char > (
478 h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
480 ::std::auto_ptr< ::XMLSpace::space > r (
482 d, f | ::xml_schema::flags::own_dom, p));
487 ::std::auto_ptr< ::XMLSpace::space >
493 ::xsd::cxx::xml::auto_initializer i (
494 (f & ::xml_schema::flags::dont_initialize) == 0,
495 (f & ::xml_schema::flags::keep_dom) == 0);
497 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
498 ::xsd::cxx::xml::dom::parse< char > (
502 throw ::xsd::cxx::tree::parsing< char > ();
504 ::std::auto_ptr< ::XMLSpace::space > r (
506 d, f | ::xml_schema::flags::own_dom, p));
511 ::std::auto_ptr< ::XMLSpace::space >
513 ::xercesc::DOMErrorHandler& h,
517 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
518 ::xsd::cxx::xml::dom::parse< char > (
522 throw ::xsd::cxx::tree::parsing< char > ();
524 ::std::auto_ptr< ::XMLSpace::space > r (
526 d, f | ::xml_schema::flags::own_dom, p));
531 ::std::auto_ptr< ::XMLSpace::space >
536 ::xsd::cxx::xml::auto_initializer i (
537 (f & ::xml_schema::flags::dont_initialize) == 0,
538 (f & ::xml_schema::flags::keep_dom) == 0);
540 ::xsd::cxx::xml::sax::std_input_source isrc (is);
544 ::std::auto_ptr< ::XMLSpace::space >
550 ::xsd::cxx::xml::auto_initializer i (
551 (f & ::xml_schema::flags::dont_initialize) == 0,
552 (f & ::xml_schema::flags::keep_dom) == 0);
554 ::xsd::cxx::xml::sax::std_input_source isrc (is);
558 ::std::auto_ptr< ::XMLSpace::space >
560 ::xercesc::DOMErrorHandler& h,
564 ::xsd::cxx::xml::sax::std_input_source isrc (is);
568 ::std::auto_ptr< ::XMLSpace::space >
574 ::xsd::cxx::xml::auto_initializer i (
575 (f & ::xml_schema::flags::dont_initialize) == 0,
576 (f & ::xml_schema::flags::keep_dom) == 0);
578 ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
582 ::std::auto_ptr< ::XMLSpace::space >
589 ::xsd::cxx::xml::auto_initializer i (
590 (f & ::xml_schema::flags::dont_initialize) == 0,
591 (f & ::xml_schema::flags::keep_dom) == 0);
593 ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
597 ::std::auto_ptr< ::XMLSpace::space >
600 ::xercesc::DOMErrorHandler& h,
604 ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
608 ::std::auto_ptr< ::XMLSpace::space >
613 ::xsd::cxx::tree::error_handler< char > h;
615 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
616 ::xsd::cxx::xml::dom::parse< char > (
619 h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();
621 ::std::auto_ptr< ::XMLSpace::space > r (
623 d, f | ::xml_schema::flags::own_dom, p));
628 ::std::auto_ptr< ::XMLSpace::space >
634 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
635 ::xsd::cxx::xml::dom::parse< char > (
639 throw ::xsd::cxx::tree::parsing< char > ();
641 ::std::auto_ptr< ::XMLSpace::space > r (
643 d, f | ::xml_schema::flags::own_dom, p));
648 ::std::auto_ptr< ::XMLSpace::space >
650 ::xercesc::DOMErrorHandler& h,
654 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
655 ::xsd::cxx::xml::dom::parse< char > (
659 throw ::xsd::cxx::tree::parsing< char > ();
661 ::std::auto_ptr< ::XMLSpace::space > r (
663 d, f | ::xml_schema::flags::own_dom, p));
668 ::std::auto_ptr< ::XMLSpace::space >
673 if (f & ::xml_schema::flags::keep_dom)
675 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > c (
676 static_cast< ::xercesc::DOMDocument* > (d.cloneNode (
true)));
678 ::std::auto_ptr< ::XMLSpace::space > r (
680 c, f | ::xml_schema::flags::own_dom, p));
685 const ::xercesc::DOMElement& e (*d.getDocumentElement ());
686 const ::xsd::cxx::xml::qualified_name< char > n (
687 ::xsd::cxx::xml::dom::name< char > (e));
689 if (n.name () ==
"space" &&
690 n.namespace_ () ==
"XMLSpace")
692 ::std::auto_ptr< ::XMLSpace::space > r (
693 ::xsd::cxx::tree::traits< ::XMLSpace::space, char >::create (
698 throw ::xsd::cxx::tree::unexpected_element < char > (
705 ::std::auto_ptr< ::XMLSpace::space >
706 space_ (::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument >& d,
710 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > c (
711 ((f & ::xml_schema::flags::keep_dom) &&
712 !(f & ::xml_schema::flags::own_dom))
713 ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (
true))
716 ::xercesc::DOMDocument& doc (c.get () ? *c : *d);
717 const ::xercesc::DOMElement& e (*doc.getDocumentElement ());
719 const ::xsd::cxx::xml::qualified_name< char > n (
720 ::xsd::cxx::xml::dom::name< char > (e));
722 if (f & ::xml_schema::flags::keep_dom)
724 (c.get () ? &c : &d),
727 if (n.name () ==
"space" &&
728 n.namespace_ () ==
"XMLSpace")
730 ::std::auto_ptr< ::XMLSpace::space > r (
731 ::xsd::cxx::tree::traits< ::XMLSpace::space, char >::create (
736 throw ::xsd::cxx::tree::unexpected_element < char > (
745 #include <xsd/cxx/tree/error-handler.hxx>
746 #include <xsd/cxx/xml/dom/serialization-source.hxx>
752 const ::XMLSpace::space& s,
757 ::xsd::cxx::xml::auto_initializer i (
758 (f & ::xml_schema::flags::dont_initialize) == 0);
760 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
763 ::xsd::cxx::tree::error_handler< char > h;
765 ::xsd::cxx::xml::dom::ostream_format_target t (o);
766 if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
768 h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
774 const ::XMLSpace::space& s,
780 ::xsd::cxx::xml::auto_initializer i (
781 (f & ::xml_schema::flags::dont_initialize) == 0);
783 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
785 ::xsd::cxx::xml::dom::ostream_format_target t (o);
786 if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
788 throw ::xsd::cxx::tree::serialization< char > ();
794 const ::XMLSpace::space& s,
795 ::xercesc::DOMErrorHandler& h,
800 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
802 ::xsd::cxx::xml::dom::ostream_format_target t (o);
803 if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
805 throw ::xsd::cxx::tree::serialization< char > ();
811 const ::XMLSpace::space& s,
816 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
819 ::xsd::cxx::tree::error_handler< char > h;
821 if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
823 h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
829 const ::XMLSpace::space& s,
835 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
837 if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
839 throw ::xsd::cxx::tree::serialization< char > ();
845 const ::XMLSpace::space& s,
846 ::xercesc::DOMErrorHandler& h,
851 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
853 if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
855 throw ::xsd::cxx::tree::serialization< char > ();
861 const ::XMLSpace::space& s,
864 ::xercesc::DOMElement& e (*d.getDocumentElement ());
865 const ::xsd::cxx::xml::qualified_name< char > n (
866 ::xsd::cxx::xml::dom::name< char > (e));
868 if (n.name () ==
"space" &&
869 n.namespace_ () ==
"XMLSpace")
875 throw ::xsd::cxx::tree::unexpected_element < char > (
883 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument >
888 ::xml_schema::dom::auto_ptr< ::xercesc::DOMDocument > d (
889 ::xsd::cxx::xml::dom::serialize< char > (
899 operator<< (::xercesc::DOMElement& e,
const space& i)
901 e << static_cast< const ::xml_schema::type& > (i);
906 b (i.element_data ().begin ()), n (i.element_data ().end ());
909 ::xercesc::DOMElement& s (
910 ::xsd::cxx::xml::dom::create_element (
921 ::xercesc::DOMAttr& a (
922 ::xsd::cxx::xml::dom::create_attribute (
926 a << *i.spaceType ();
931 operator<< (::xercesc::DOMElement& e,
const element_data& i)
933 e << static_cast< const ::xml_schema::type& > (i);
938 ::xercesc::DOMAttr& a (
939 ::xsd::cxx::xml::dom::create_attribute (
949 ::xercesc::DOMAttr& a (
950 ::xsd::cxx::xml::dom::create_attribute (
960 ::xercesc::DOMAttr& a (
961 ::xsd::cxx::xml::dom::create_attribute (
971 ::xercesc::DOMAttr& a (
972 ::xsd::cxx::xml::dom::create_attribute (
982 ::xercesc::DOMAttr& a (
983 ::xsd::cxx::xml::dom::create_attribute (
992 #include <xsd/cxx/post.hxx>