|
Revision 111, 1.7 kB
(checked in by mido, 17 years ago)
|
|
pridana knihovna XSD (a jeji chlebodarkyne XERCES), v ramci Win32 zprovoznen priklad tests/test_xsd_hello.cxx
|
| Line | |
|---|
| 1 | // file : xsd/cxx/xml/dom/serialization-header.hxx |
|---|
| 2 | // author : Boris Kolpackov <boris@codesynthesis.com> |
|---|
| 3 | // copyright : Copyright (c) 2005-2008 Code Synthesis Tools CC |
|---|
| 4 | // license : GNU GPL v2 + exceptions; see accompanying LICENSE file |
|---|
| 5 | |
|---|
| 6 | #ifndef XSD_CXX_XML_DOM_SERIALIZATION_HEADER_HXX |
|---|
| 7 | #define XSD_CXX_XML_DOM_SERIALIZATION_HEADER_HXX |
|---|
| 8 | |
|---|
| 9 | #include <map> |
|---|
| 10 | #include <string> |
|---|
| 11 | |
|---|
| 12 | #include <xercesc/dom/DOMElement.hpp> |
|---|
| 13 | |
|---|
| 14 | namespace xsd |
|---|
| 15 | { |
|---|
| 16 | namespace cxx |
|---|
| 17 | { |
|---|
| 18 | namespace xml |
|---|
| 19 | { |
|---|
| 20 | namespace dom |
|---|
| 21 | { |
|---|
| 22 | // |
|---|
| 23 | // |
|---|
| 24 | class no_prefix {}; |
|---|
| 25 | |
|---|
| 26 | template <typename C> |
|---|
| 27 | std::basic_string<C> |
|---|
| 28 | prefix (const C* ns, const xercesc::DOMElement&); |
|---|
| 29 | |
|---|
| 30 | template <typename C> |
|---|
| 31 | inline std::basic_string<C> |
|---|
| 32 | prefix (const std::basic_string<C>& ns, const xercesc::DOMElement& e) |
|---|
| 33 | { |
|---|
| 34 | return prefix (ns.c_str (), e); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | // |
|---|
| 38 | // |
|---|
| 39 | template <typename C> |
|---|
| 40 | void |
|---|
| 41 | clear (xercesc::DOMElement&); |
|---|
| 42 | |
|---|
| 43 | // |
|---|
| 44 | // |
|---|
| 45 | template <typename C> |
|---|
| 46 | struct namespace_info |
|---|
| 47 | { |
|---|
| 48 | typedef std::basic_string<C> string; |
|---|
| 49 | |
|---|
| 50 | namespace_info () |
|---|
| 51 | { |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | namespace_info (const string& name_, const string& schema_) |
|---|
| 55 | : name (name_), |
|---|
| 56 | schema (schema_) |
|---|
| 57 | { |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | std::basic_string<C> name; |
|---|
| 61 | std::basic_string<C> schema; |
|---|
| 62 | }; |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | // Map of namespace prefix to namespace_info. |
|---|
| 66 | // |
|---|
| 67 | template <typename C> |
|---|
| 68 | struct namespace_infomap: |
|---|
| 69 | public std::map<std::basic_string<C>, namespace_info<C> > |
|---|
| 70 | { |
|---|
| 71 | }; |
|---|
| 72 | } |
|---|
| 73 | } |
|---|
| 74 | } |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | #include <xsd/cxx/xml/dom/serialization-header.txx> |
|---|
| 78 | |
|---|
| 79 | #endif // XSD_CXX_XML_DOM_SERIALIZATION_HEADER_HXX |
|---|