aboutsummaryrefslogtreecommitdiff
path: root/examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-18 11:17:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-18 11:17:51 +0200
commitd80d096ee8743fd6f7382d274272b0b6d7faf9bf (patch)
treed0f0bee1e645cb2b86b6837ac0db8a7d2821e533 /examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx
parent0e4637025fa8d1b4234b0512561d31f0dd023843 (diff)
Support for schema evolution using substitution groups
New examples: hybrid/evolution/ignore and hybrid/evolution/passthrough.
Diffstat (limited to 'examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx')
-rw-r--r--examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx66
1 files changed, 66 insertions, 0 deletions
diff --git a/examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx b/examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx
new file mode 100644
index 0000000..1956e2c
--- /dev/null
+++ b/examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx
@@ -0,0 +1,66 @@
+// file : examples/cxx/hybrid/evolution/passthrough/unknown-type-pimpl.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : not copyrighted - public domain
+
+#ifndef UNKNOWN_TYPE_PIMPL_HXX
+#define UNKNOWN_TYPE_PIMPL_HXX
+
+namespace transform
+{
+ // Customized unknown_type parser implementation.
+ //
+ class unknown_type_pimpl: public unknown_type_base_pimpl
+ {
+ public:
+ virtual void
+ _pre ();
+
+ // Wildcard content callbacks. All the unknown content is routed
+ // to these functions. We use them to construct the raw XML
+ // representation of the unknown transformation.
+ //
+ virtual void
+ _start_any_element (const xml_schema::ro_string& ns,
+ const xml_schema::ro_string& name,
+ const char* type);
+
+ virtual void
+ _end_any_element (const xml_schema::ro_string& ns,
+ const xml_schema::ro_string& name);
+
+ virtual void
+ _any_attribute (const xml_schema::ro_string& ns,
+ const xml_schema::ro_string& name,
+ const xml_schema::ro_string& value);
+
+ virtual void
+ _any_characters (const xml_schema::ro_string&);
+
+ // Low-level content callbacks. These are normally implemented by
+ // the generated parsers. However, we need to intercept them and
+ // re-route the known elements and attributes to the base parser
+ // and the unknown content to the wildcard callbacks above.
+ //
+ virtual void
+ _start_element (const xml_schema::ro_string& ns,
+ const xml_schema::ro_string& name,
+ const char* type);
+
+ virtual void
+ _end_element (const xml_schema::ro_string& ns,
+ const xml_schema::ro_string& name);
+
+ virtual void
+ _attribute (const xml_schema::ro_string& ns,
+ const xml_schema::ro_string& name,
+ const xml_schema::ro_string& value);
+
+ virtual void
+ _characters (const xml_schema::ro_string&);
+
+ private:
+ xml::element* cur_;
+ };
+}
+
+#endif // UNKNOWN_TYPE_PIMPL_HXX