[xsd-users] simple regex replacements

Boris Kolpackov boris at codesynthesis.com
Mon Apr 10 15:58:54 EDT 2006


Hi Andrew,

Andrew Glynn <dasein42 at earthlink.net> writes:

> I'm rather new to regex and don't know perl (my background is Smalltalk
> of all things).  Can anyone give a simpler example of replacing one
> string in a namespace with another to generate a valid C++ namespace?

A detailed explanation of how the namespace regex substitution works is
available in the xsd man pages (see under the --namespace-regex option):

http://codesynthesis.com/projects/xsd/documentation/xsd.xhtml


If you want to replace one string with another then you can do something
like this:

--namespace-regex '%.* <xml-ns>%<cxx-ns>%'

Where <xml-ns> should be replaced with an XML namespace and <cxx-ns>
with a C++ namespace, e.g.,

--namespace-regex '%.* http://www.example.com/foo%example::foo%'


We should probably have a short-cut option for cases like this that
does not involve regex, something like:


--namespace-map http://www.example.com/foo=example::foo


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060410/ee30355f/attachment.pgp


More information about the xsd-users mailing list