From f0510d2f90467de8e8f260b47d79a9baaf9bef17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2009 07:15:29 +0200 Subject: Start tracking XSD with git --- libxsd/xsd/cxx/xml/dom/serialization-header.hxx | 81 +++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 libxsd/xsd/cxx/xml/dom/serialization-header.hxx (limited to 'libxsd/xsd/cxx/xml/dom/serialization-header.hxx') diff --git a/libxsd/xsd/cxx/xml/dom/serialization-header.hxx b/libxsd/xsd/cxx/xml/dom/serialization-header.hxx new file mode 100644 index 0000000..c8d836c --- /dev/null +++ b/libxsd/xsd/cxx/xml/dom/serialization-header.hxx @@ -0,0 +1,81 @@ +// file : xsd/cxx/xml/dom/serialization-header.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_XML_DOM_SERIALIZATION_HEADER_HXX +#define XSD_CXX_XML_DOM_SERIALIZATION_HEADER_HXX + +#include +#include + +#include + +namespace xsd +{ + namespace cxx + { + namespace xml + { + namespace dom + { + // Find an existing prefix or establish a new one. Try to use + // hint if provided and available. + // + template + std::basic_string + prefix (const C* ns, xercesc::DOMElement&, const C* hint = 0); + + template + inline std::basic_string + prefix (const std::basic_string& ns, + xercesc::DOMElement& e, + const C* hint = 0) + { + return prefix (ns.c_str (), e, hint); + } + + // + // + template + void + clear (xercesc::DOMElement&); + + // + // + template + class namespace_info + { + public: + typedef std::basic_string string; + + namespace_info () + { + } + + namespace_info (const string& name_, const string& schema_) + : name (name_), + schema (schema_) + { + } + + std::basic_string name; + std::basic_string schema; + }; + + + // Map of namespace prefix to namespace_info. + // + template + class namespace_infomap: + public std::map, namespace_info > + { + }; + } + } + } +} + +#include + +#endif // XSD_CXX_XML_DOM_SERIALIZATION_HEADER_HXX -- cgit v1.1