From rlischner at proteuseng.com Fri Jan 31 13:58:02 2014 From: rlischner at proteuseng.com (Ray Lischner) Date: Fri Jan 31 23:00:29 2014 Subject: [xsd-users] inline namespaces Message-ID: <68F9DD51BF61E943BFA45D744048A7A7319D719980@nbp-ex01.proteus-technologies.com> In the past, we used to encode schema version numbers in the namespace. On the one hand, it ensured binary compatibility when a schema changed, but on the other hand, it required large-scale source code changes when a schema's version number incremented. With inline namespaces, we can gain the advantage of versioned names, but without the associated source-code changes when the version changes. The trick is to convince Code Synthesis to map an XML schema to a set of C++ namespaces that includes an inline namespace. For example, we might want, XML namespace x:y:v1 to map to: namespace x { namespace y { inline namespace v1 { In one strange instance, we also had XML schema namespace x:v1:y, which would need to be mapped to: namespace x { inline namespace v1 { namespace y { Any ideas on how we might do this? Perhaps the --namespace-regex option can use a magic character in the C++ namespace to mean "make this inline", e.g., --namespace regex '@^.* ([^:]+):([^:]+):(v\d+)@$1::$2::*$3@', where the '*' means 'inline'. Ray Lischner, Distinguished Member of Technical Staff 133 National Business Pkwy, Ste 150 t. 443.539.3448 Annapolis Junction, MD 20701 c. 410.854.9787 rlischner@proteuseng.com f. 443.539.3370